binder::binder_impl

Trait DeserializeOption

Source
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§

Source

fn deserialize_option( parcel: &BorrowedParcel<'_>, ) -> Result<Option<Self>, StatusCode>

Deserialize an Option of this type from the given parcel.

Source

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.

Implementations on Foreign Types§

Source§

impl<T: DeserializeArray> DeserializeOption for Vec<T>

Source§

impl<T: DeserializeArray, const N: usize> DeserializeOption for [T; N]

Source§

impl<T: DeserializeOption> DeserializeOption for Box<T>

Implementors§