Trait TryFromInto

Source
pub trait TryFromInto: View
where Self::V: SpecTryFromInto<Src = <Self::SrcOwned as View>::V, Dst = <Self::DstOwned as View>::V>, <Self::SrcOwned as View>::V: SpecTryFrom<<Self::DstOwned as View>::V>, <Self::DstOwned as View>::V: SpecTryFrom<<Self::SrcOwned as View>::V>,
{ type Src<'a>: View<V = <Self::SrcOwned as View>::V> + TryFrom<Self::Dst<'a>>; type Dst<'a>: View<V = <Self::DstOwned as View>::V> + TryFrom<Self::Src<'a>>; type SrcOwned: View + TryFrom<Self::DstOwned> where <Self::SrcOwned as View>::V: SpecTryFrom<<Self::DstOwned as View>::V>; type DstOwned: View + TryFrom<Self::SrcOwned> where <Self::DstOwned as View>::V: SpecTryFrom<<Self::SrcOwned as View>::V>; // Provided methods fn apply( s: Self::Src<'_>, ) -> Result<Self::Dst<'_>, <Self::Dst<'_> as TryFrom<Self::Src<'_>>>::Error> { ... } fn rev_apply( s: Self::Dst<'_>, ) -> Result<Self::Src<'_>, <Self::Src<'_> as TryFrom<Self::Dst<'_>>>::Error> { ... } }
Expand description

Faillible version of Iso.

Required Associated Types§

Source

type Src<'a>: View<V = <Self::SrcOwned as View>::V> + TryFrom<Self::Dst<'a>>

The source type

Source

type Dst<'a>: View<V = <Self::DstOwned as View>::V> + TryFrom<Self::Src<'a>>

The destination type

Source

type SrcOwned: View + TryFrom<Self::DstOwned> where <Self::SrcOwned as View>::V: SpecTryFrom<<Self::DstOwned as View>::V>

The owned version of the source type.

Source

type DstOwned: View + TryFrom<Self::SrcOwned> where <Self::DstOwned as View>::V: SpecTryFrom<<Self::SrcOwned as View>::V>

The owned version of the destination type.

Provided Methods§

Source

fn apply( s: Self::Src<'_>, ) -> Result<Self::Dst<'_>, <Self::Dst<'_> as TryFrom<Self::Src<'_>>>::Error>

Applies the faillible conversion to the source type.

Source

fn rev_apply( s: Self::Dst<'_>, ) -> Result<Self::Src<'_>, <Self::Src<'_> as TryFrom<Self::Dst<'_>>>::Error>

Applies the reverse faillible conversion to the destination type.

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§