Trait MaybeTryFrom

Source
pub trait MaybeTryFrom<T>: Sized {
    type Error;

    // Required method
    fn maybe_try_from(item: T) -> NullableResult<Self, Self::Error>;
}
Expand description

Analogue of TryFrom that returns a NullableResult

Required Associated Types§

Source

type Error

The type that is returned if conversion fails

Required Methods§

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: TryFrom<T>> MaybeTryFrom<T> for U

Source§

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