Trait AutoMapsFrom

Source
pub trait AutoMapsFrom<T> {
    // Required method
    fn map_from(src: T) -> Self;
}
Expand description

This trait is the opposite of AutoMapsTo. This is automatically implemented for any type that implements AutoMapsTo.

For any type where you can do

let dest: D = source.map_to();

You can also do

let dest = DestType::map_from(source);

Required Methods§

Source

fn map_from(src: T) -> Self

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§

Source§

impl<D, S> AutoMapsFrom<S> for D
where S: AutoMapsTo<D>,