pub trait DeserializeOption: Deserialize {
// Provided methods
fn deserialize_option(
parcel: &BorrowedParcel<'_>,
) -> Result<Option<Self>, StatusCode> { ... }
fn deserialize_option_from(
this: &mut Option<Self>,
parcel: &BorrowedParcel<'_>,
) -> Result<(), StatusCode> { ... }
}
Expand description
Helper trait for types that can be nullable when deserialized.
Provided Methods§
Sourcefn deserialize_option(
parcel: &BorrowedParcel<'_>,
) -> Result<Option<Self>, StatusCode>
fn deserialize_option( parcel: &BorrowedParcel<'_>, ) -> Result<Option<Self>, StatusCode>
Deserialize an Option of this type from the given parcel.
Sourcefn deserialize_option_from(
this: &mut Option<Self>,
parcel: &BorrowedParcel<'_>,
) -> Result<(), StatusCode>
fn deserialize_option_from( this: &mut Option<Self>, parcel: &BorrowedParcel<'_>, ) -> Result<(), StatusCode>
Deserialize an Option of this type from the given parcel onto the current object. This operation will overwrite the current value partially or completely, depending on how much data is available.
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.