Trait mz_proto::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§

Object Safety§

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§