Skip to main content

CrossModuleConvert

Trait CrossModuleConvert 

Source
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§

Source

type Source

The source type

Source

type Target

The target type

Required Methods§

Source

fn convert(source: &Self::Source) -> ConversionResult<Self::Target>

Convert from source to target

Source

fn convert_with_options( source: &Self::Source, options: &ConversionOptions, ) -> ConversionResult<Self::Target>

Convert with options

Source

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.

Implementors§