fn target_for_param_type(&self, param: &ParamType) -> Option<ScalarType> {
        use ParamType::*;
        assert_eq!(
            self.compat,
            Some(
                param
                    .try_into()
                    .expect("target_for_param_type only supports polymorphic parameters")
            ),
            "cannot use polymorphic solution for different compatibility classes"
        );

        assert!(
            !matches!(param, RecordAny),
            "RecordAny should not be cast to a target type"
        );

        match param {
            AnyCompatible | ArrayAny | ListAny | ListAnyCompatible | MapAny | MapAnyCompatible
            | NonVecAny => self.key.clone(),
            ArrayAnyCompatible => self
                .key
                .as_ref()
                .map(|key| ScalarType::Array(Box::new(key.clone()))),
            ListElementAnyCompatible => self
                .key
                .as_ref()
                .map(|key| key.unwrap_list_element_type().clone()),
            _ => unreachable!(
                "cannot use polymorphic solution to resolve target type for param {:?}",
                param,
            ),
        }
    }
// Determines the appropriate `ScalarType` for the given `ParamType` based
// on the polymorphic solution.
Determines the appropriate `ScalarType` for the given `ParamType` based
on the polymorphic solution.
Determines the appropriate ` ScalarType ` for the given ` ParamType ` based on the polymorphic solution .
fn target_for_param_type(&self, param: &ParamType) -> Option<ScalarType> {
        use ParamType::*;
        assert_eq!(
            self.compat,
            Some(
                param
                    .try_into()
                    .expect("target_for_param_type only supports polymorphic parameters")
            ),
            "cannot use polymorphic solution for different compatibility classes"
        );
        assert!(
            !matches!(param, RecordAny),
            "RecordAny should not be cast to a target type"
        );
        match param {
            AnyCompatible | ArrayAny | ListAny | ListAnyCompatible | MapAny | MapAnyCompatible
            | NonVecAny => self.key.clone(),
            ArrayAnyCompatible => self
                .key
                .as_ref()
                .map(|key| ScalarType::Array(Box::new(key.clone()))),
            ListElementAnyCompatible => self
                .key
                .as_ref()
                .map(|key| key.unwrap_list_element_type().clone()),
            _ => unreachable!(
                "cannot use polymorphic solution to resolve target type for param {:?}",
                param,
            ),
        }
    }
fn target_for_param_type ( & self , param : & ParamType ) -> Option < ScalarType > { use ParamType :: * ; assert_eq ! ( self compat Some ( param try_into ( ) expect ( " " ) ) " " ) ; assert ! ( matches ( param RecordAny ) " " ) ; match param { AnyCompatible | ArrayAny | ListAny | ListAnyCompatible | MapAny | MapAnyCompatible | NonVecAny => self . key . clone ( ) , ArrayAnyCompatible => self . key . as_ref ( ) . map ( | key | ScalarType :: Array ( Box :: new ( key . clone ( ) ) ) ) , ListElementAnyCompatible => self . key . as_ref ( ) . map ( | key | key . unwrap_list_element_type ( ) . clone ( ) ) , _ => unreachable ! ( " " param ) , } }
Determines the appropriate `ScalarType` for the given `ParamType` based
on the polymorphic solution.
Determines the appropriate ` ScalarType ` for the given ` ParamType ` based on the polymorphic solution .
&self
param
&ParamType
&self
param
&ParamType