binder::binder_impl

Trait SerializeOption

Source
pub trait SerializeOption: Serialize {
    // Provided method
    fn serialize_option(
        this: Option<&Self>,
        parcel: &mut BorrowedParcel<'_>,
    ) -> Result<(), StatusCode> { ... }
}
Expand description

Helper trait for types that can be nullable when serialized.

Provided Methods§

Source

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

Serialize an Option of this type into the given parcel.

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 SerializeOption for str

Source§

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

Source§

impl SerializeOption for String

Source§

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

Source§

impl<T: SerializeArray> SerializeOption for [T]

Source§

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

Source§

impl<T: SerializeArray> SerializeOption for Vec<T>

Source§

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

Source§

impl<T: SerializeArray, const N: usize> SerializeOption for [T; N]

Source§

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

Source§

impl<T: SerializeOption + ?Sized> SerializeOption for &T

Source§

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

Source§

impl<T: SerializeOption> SerializeOption for Box<T>

Source§

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

Implementors§