pub trait SerializeArray: Serialize + Sized {
// Provided method
fn serialize_array(
slice: &[Self],
parcel: &mut BorrowedParcel<'_>,
) -> Result<(), StatusCode> { ... }
}
Expand description
Helper trait for types that can be serialized as arrays.
Defaults to calling Serialize::serialize() manually for every element,
but can be overridden for custom implementations like writeByteArray
.
Provided Methods§
Sourcefn serialize_array(
slice: &[Self],
parcel: &mut BorrowedParcel<'_>,
) -> Result<(), StatusCode>
fn serialize_array( slice: &[Self], parcel: &mut BorrowedParcel<'_>, ) -> Result<(), StatusCode>
Serialize an array 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.