Trait mz_proto::IntoRustIfSome
source · pub trait IntoRustIfSome<T> {
// Required method
fn into_rust_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 into_rust_if_some<S: ToString>( self, field: S, ) -> Result<T, TryFromProtoError>
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl<R, P> IntoRustIfSome<R> for Option<P>where
R: RustType<P>,
impl<R, P> IntoRustIfSome<R> for Option<P>where
R: RustType<P>,
A blanket implementation for Option<U>
where U
is the
RustType::Proto
type for T
.