TryInto

Trait TryInto 

Source
pub trait TryInto<T>
where T: View, Self: View + Sized, Self::V: SpecTryInto<T::V>,
{ type Error; // Required method exec fn ex_try_into(self) -> res : Result<T, Self::Error>; }
Expand description

Vest equivalent of std::convert::TryInto.

Required Associated Types§

Source

type Error

The type returned in the event of a conversion error.

Required Methods§

Source

exec fn ex_try_into(self) -> res : Result<T, Self::Error>

ensures
res matches Ok(
    v,
) ==> {
    &&& self@.spec_try_into() is Ok
    &&& self@.spec_try_into() matches Ok(v_) && v@ == v_

},
res matches Err(e) ==> self@.spec_try_into() is Err,

Vest equivalent of std::convert::TryInto::try_into.

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<T, U> TryInto<U> for T
where T: View, U: View + TryFrom<T>, U::V: SpecTryFrom<T::V>,

Source§

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