/// Checks Rust and Matlab types compatibility
Checks Rust and Matlab types compatibility
Checks Rust and Matlab types compatibility
pub fn match_types(self) -> Result<Self> {
        unsafe {
            if (TypeId::of::<T>() == TypeId::of::<f64>()
                || TypeId::of::<T>() == TypeId::of::<Vec<f64>>())
                && (*self.matvar_t).data_type == ffi::matio_types_MAT_T_DOUBLE
            {
                return Ok(self);
            }
            Err(MatioError::MatType(
                type_name::<T>().to_string(),
                {
                    match (*self.matvar_t).data_type {
                        ffi::matio_types_MAT_T_DOUBLE => "DOUBLE",
                        _ => "UNKNOWN",
                    }
                }
                .to_string(),
            ))
        }
    }
pub fn match_types ( self ) -> Result < Self > { unsafe { if ( TypeId :: of :: < T > ( ) == TypeId :: of :: < f64 > ( ) || TypeId :: of :: < T > ( ) == TypeId :: of :: < Vec < f64 > > ( ) ) && ( * self . matvar_t ) . data_type == ffi :: matio_types_MAT_T_DOUBLE { return Ok ( self ) ; } Err ( MatioError :: MatType ( type_name :: < T > ( ) . to_string ( ) , { match ( * self . matvar_t ) . data_type { ffi :: matio_types_MAT_T_DOUBLE => " " , _ => " " , } } . to_string ( ) , ) ) } }
Checks Rust and Matlab types compatibility
Checks Rust and Matlab types compatibility
self