pub fn try_from_option_field<F, T, E>(
    field: Option<F>,
    field_name: &'static str,
) -> Result<T, ProxyDecodeError>
where
    T: TryFrom<F, Error = E>,
    ProxyDecodeError: From<E>,
{
    Ok(T::try_from(
        field.ok_or(ProxyDecodeError::MissingField(field_name))?,
    )?)
}
/// Converts an optional proto field into a Rust type using `From` / `TryFrom`.
/// Returns `Err(ProtoMappingError::MissingField(field))` if the field is
/// `None`.
Converts an optional proto field into a Rust type using `From` / `TryFrom`.
Converts an optional proto field into a Rust type using ` From ` / ` TryFrom ` .
pub fn try_from_option_field<F, T, E>(
    field: Option<F>,
    field_name: &'static str,
) -> Result<T, ProxyDecodeError>
where
    T: TryFrom<F, Error = E>,
    ProxyDecodeError: From<E>,
{
    Ok(T::try_from(
        field.ok_or(ProxyDecodeError::MissingField(field_name))?,
    )?)
}
pub fn try_from_option_field < F , T , E > ( field : Option < F > , field_name : & ' static str , ) -> Result < T , ProxyDecodeError > where T : TryFrom < F , Error = E > , ProxyDecodeError : From < E > , { Ok ( T :: try_from ( field . ok_or ( ProxyDecodeError :: MissingField ( field_name ) ) ? , ) ? ) }
Converts an optional proto field into a Rust type using `From` / `TryFrom`.
Converts an optional proto field into a Rust type using ` From ` / ` TryFrom ` .
field
Option<F>
field_name
&'static str
field
Option<F>
field_name
&'static str