conv

Trait TryInto

Source
pub trait TryInto<Dst> {
    type Err: Error;

    // Required method
    fn try_into(self) -> Result<Dst, Self::Err>;
}
Expand description

This is the dual of TryFrom; see that trait for information.

Where possible, prefer using this trait over TryFrom for generic constraints, but prefer implementing TryFrom.

Required Associated Types§

Source

type Err: Error

The error type produced by a failed conversion.

Required Methods§

Source

fn try_into(self) -> Result<Dst, Self::Err>

Convert the subject into the destination type.

Implementors§

Source§

impl<Src, Dst> TryInto<Dst> for Src
where Dst: TryFrom<Src>,

Source§

type Err = <Dst as TryFrom<Src>>::Err