Struct model_mapper::with::ToStringMapper

source ·
pub struct ToStringMapper;
Expand description

Maps from any type to its display string

Trait Implementations§

source§

impl<T: ToString> TypeMapper<T, String> for ToStringMapper

source§

fn map(from: T) -> String

Maps between types
source§

fn try_map(from: F) -> Result<I, Infallible>

Maps between types
source§

fn map_wrapped<W>(from: W) -> <W as Wrapper<F>>::Wrapper<I>
where W: Wrapper<F>,

Maps between Wrapper types
source§

fn try_map_wrapped<W>( from: W, ) -> Result<<W as Wrapper<F>>::Wrapper<I>, Infallible>
where W: Wrapper<F>,

Maps between Wrapper types
source§

fn map_nested_wrapped<NW, W>( from: NW, ) -> <NW as NestedWrapper<W, F>>::NestedWrapper<I>
where NW: NestedWrapper<W, F>, W: Wrapper<F>,

Maps between Wrapper types
source§

fn try_map_nested_wrapped<NW, W>( from: NW, ) -> Result<<NW as NestedWrapper<W, F>>::NestedWrapper<I>, Infallible>
where NW: NestedWrapper<W, F>, W: Wrapper<F>,

Maps between Wrapper types
source§

fn map_into_option(from: F) -> Option<I>

Maps encapsulating into an Option
source§

fn try_map_into_option(from: F) -> Result<Option<I>, Infallible>

Maps encapsulating into an Option
source§

fn map_wrapped_into_option<W>(from: W) -> Option<<W as Wrapper<F>>::Wrapper<I>>
where W: Wrapper<F>,

Maps a Wrapper encapsulating into an Option
source§

fn try_map_wrapped_into_option<W>( from: W, ) -> Result<Option<<W as Wrapper<F>>::Wrapper<I>>, Infallible>
where W: Wrapper<F>,

Maps a Wrapper encapsulating into an Option
source§

fn map_nested_wrapped_into_option<NW, W>( from: NW, ) -> Option<<NW as NestedWrapper<W, F>>::NestedWrapper<I>>
where NW: NestedWrapper<W, F>, W: Wrapper<F>,

Maps a nested Wrapper encapsulating into an Option
source§

fn try_map_nested_wrapped_into_option<NW, W>( from: NW, ) -> Result<Option<<NW as NestedWrapper<W, F>>::NestedWrapper<I>>, Infallible>
where NW: NestedWrapper<W, F>, W: Wrapper<F>,

Maps a nested Wrapper encapsulating into an Option
source§

fn try_map_removing_option(from: Option<F>) -> Result<I, MapperError>

Maps removing an Option
source§

fn map_removing_option_default(from: Option<F>) -> I
where I: Default,

Maps removing an Option, returning a default value if None
source§

fn try_map_removing_option_default(from: Option<F>) -> Result<I, Infallible>
where I: Default,

Maps removing an Option, returning a default value if None
source§

fn try_map_wrapped_removing_option<W>( from: Option<W>, ) -> Result<<W as Wrapper<F>>::Wrapper<I>, MapperError>
where W: Wrapper<F>,

Maps a wrapped type removing an Option
source§

fn map_wrapped_removing_option_default<W>( from: Option<W>, ) -> <W as Wrapper<F>>::Wrapper<I>
where W: Wrapper<F>, <W as Wrapper<F>>::Wrapper<I>: Default,

Maps a wrapped type removing an Option, returning a default value if None
source§

fn try_map_wrapped_removing_option_default<W>( from: Option<W>, ) -> Result<<W as Wrapper<F>>::Wrapper<I>, Infallible>
where W: Wrapper<F>, <W as Wrapper<F>>::Wrapper<I>: Default,

Maps a wrapped type removing an Option, returning a default value if None
source§

fn try_map_nested_wrapped_removing_option<NW, W>( from: Option<NW>, ) -> Result<<NW as NestedWrapper<W, F>>::NestedWrapper<I>, MapperError>
where NW: NestedWrapper<W, F>, W: Wrapper<F>,

Maps a nested wrapped type removing an Option
source§

fn map_nested_wrapped_removing_option_default<NW, W>( from: Option<NW>, ) -> <NW as NestedWrapper<W, F>>::NestedWrapper<I>
where NW: NestedWrapper<W, F>, W: Wrapper<F>, <NW as NestedWrapper<W, F>>::NestedWrapper<I>: Default,

Maps a nested wrapped type removing an Option, returning a default value if None
source§

fn try_map_nested_wrapped_removing_option_default<NW, W>( from: Option<NW>, ) -> Result<<NW as NestedWrapper<W, F>>::NestedWrapper<I>, Infallible>
where NW: NestedWrapper<W, F>, W: Wrapper<F>, <NW as NestedWrapper<W, F>>::NestedWrapper<I>: Default,

Maps a nested wrapped type removing an Option, returning a default value if None

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.