mz_proto

Trait TryIntoIfSome

Source
pub trait TryIntoIfSome<T> {
    // Required method
    fn try_into_if_some<S: ToString>(
        self,
        field: S,
    ) -> Result<T, TryFromProtoError>;
}
Expand description

Convenience syntax for trying to convert a Self value of type Option<U> to T if the value is Some(value), or returning TryFromProtoError::MissingField if the value is None.

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.

Implementations on Foreign Types§

Source§

impl<T, U> TryIntoIfSome<T> for Option<U>
where T: TryFrom<U, Error = TryFromProtoError>,

A blanket implementation for Option<U> where U is the Proto$T type for T.

Implementors§