pub trait CrossModuleConvert {
type Source;
type Target;
// Required methods
fn convert(source: &Self::Source) -> ConversionResult<Self::Target>;
fn convert_with_options(
source: &Self::Source,
options: &ConversionOptions,
) -> ConversionResult<Self::Target>;
fn can_convert(source: &Self::Source) -> bool;
}Expand description
Trait for cross-module data conversion
Required Associated Types§
Required Methods§
Sourcefn convert(source: &Self::Source) -> ConversionResult<Self::Target>
fn convert(source: &Self::Source) -> ConversionResult<Self::Target>
Convert from source to target
Sourcefn convert_with_options(
source: &Self::Source,
options: &ConversionOptions,
) -> ConversionResult<Self::Target>
fn convert_with_options( source: &Self::Source, options: &ConversionOptions, ) -> ConversionResult<Self::Target>
Convert with options
Sourcefn can_convert(source: &Self::Source) -> bool
fn can_convert(source: &Self::Source) -> bool
Check if conversion is possible without actually converting
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.