Trait mz_repr::proto::TryIntoIfSome
source · [−]pub trait TryIntoIfSome<T> {
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
fn try_into_if_some<S: ToString>(self, field: S) -> Result<T, TryFromProtoError>
Implementations on Foreign Types
sourceimpl<T, U> TryIntoIfSome<T> for Option<U> where
T: TryFrom<U, Error = TryFromProtoError>,
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
.