Trait model_mapper::with::TypeFallibleMapper
source · pub trait TypeFallibleMapper<F, I> {
type Error;
// Required method
fn try_map(from: F) -> Result<I, Self::Error>;
// Provided methods
fn try_map_wrapped<W>(
from: W,
) -> Result<<W as Wrapper<F>>::Wrapper<I>, Self::Error>
where W: Wrapper<F> { ... }
fn try_map_nested_wrapped<NW, W>(
from: NW,
) -> Result<<NW as NestedWrapper<W, F>>::NestedWrapper<I>, Self::Error>
where NW: NestedWrapper<W, F>,
W: Wrapper<F> { ... }
fn try_map_into_option(from: F) -> Result<Option<I>, Self::Error> { ... }
fn try_map_wrapped_into_option<W>(
from: W,
) -> Result<Option<<W as Wrapper<F>>::Wrapper<I>>, Self::Error>
where W: Wrapper<F> { ... }
fn try_map_nested_wrapped_into_option<NW, W>(
from: NW,
) -> Result<Option<<NW as NestedWrapper<W, F>>::NestedWrapper<I>>, Self::Error>
where NW: NestedWrapper<W, F>,
W: Wrapper<F> { ... }
fn try_map_removing_option(from: Option<F>) -> Result<I, MapperError>
where Self::Error: Error + Send + Sync + 'static { ... }
fn try_map_wrapped_removing_option<W>(
from: Option<W>,
) -> Result<<W as Wrapper<F>>::Wrapper<I>, MapperError>
where W: Wrapper<F>,
Self::Error: Error + Send + Sync + 'static { ... }
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>,
Self::Error: Error + Send + Sync + 'static { ... }
}Expand description
Trait to try to map between types
Required Associated Types§
Required Methods§
Provided Methods§
sourcefn try_map_wrapped<W>(
from: W,
) -> Result<<W as Wrapper<F>>::Wrapper<I>, Self::Error>where
W: Wrapper<F>,
fn try_map_wrapped<W>(
from: W,
) -> Result<<W as Wrapper<F>>::Wrapper<I>, Self::Error>where
W: Wrapper<F>,
Maps between Wrapper types
sourcefn try_map_nested_wrapped<NW, W>(
from: NW,
) -> Result<<NW as NestedWrapper<W, F>>::NestedWrapper<I>, Self::Error>where
NW: NestedWrapper<W, F>,
W: Wrapper<F>,
fn try_map_nested_wrapped<NW, W>(
from: NW,
) -> Result<<NW as NestedWrapper<W, F>>::NestedWrapper<I>, Self::Error>where
NW: NestedWrapper<W, F>,
W: Wrapper<F>,
Maps between Wrapper types
sourcefn try_map_into_option(from: F) -> Result<Option<I>, Self::Error>
fn try_map_into_option(from: F) -> Result<Option<I>, Self::Error>
Maps encapsulating into an Option
sourcefn try_map_wrapped_into_option<W>(
from: W,
) -> Result<Option<<W as Wrapper<F>>::Wrapper<I>>, Self::Error>where
W: Wrapper<F>,
fn try_map_wrapped_into_option<W>(
from: W,
) -> Result<Option<<W as Wrapper<F>>::Wrapper<I>>, Self::Error>where
W: Wrapper<F>,
sourcefn try_map_nested_wrapped_into_option<NW, W>(
from: NW,
) -> Result<Option<<NW as NestedWrapper<W, F>>::NestedWrapper<I>>, Self::Error>where
NW: NestedWrapper<W, F>,
W: Wrapper<F>,
fn try_map_nested_wrapped_into_option<NW, W>(
from: NW,
) -> Result<Option<<NW as NestedWrapper<W, F>>::NestedWrapper<I>>, Self::Error>where
NW: NestedWrapper<W, F>,
W: Wrapper<F>,
sourcefn try_map_removing_option(from: Option<F>) -> Result<I, MapperError>
fn try_map_removing_option(from: Option<F>) -> Result<I, MapperError>
Maps removing an Option
sourcefn try_map_wrapped_removing_option<W>(
from: Option<W>,
) -> Result<<W as Wrapper<F>>::Wrapper<I>, MapperError>
fn try_map_wrapped_removing_option<W>( from: Option<W>, ) -> Result<<W as Wrapper<F>>::Wrapper<I>, MapperError>
Maps a wrapped type removing an Option
sourcefn try_map_nested_wrapped_removing_option<NW, W>(
from: Option<NW>,
) -> Result<<NW as NestedWrapper<W, F>>::NestedWrapper<I>, MapperError>
fn try_map_nested_wrapped_removing_option<NW, W>( from: Option<NW>, ) -> Result<<NW as NestedWrapper<W, F>>::NestedWrapper<I>, MapperError>
Maps a nested wrapped type removing an Option
Object Safety§
This trait is not object safe.