Skip to main content

SerializeUnsized

Trait SerializeUnsized 

Source
pub trait SerializeUnsized<S: Fallible + ?Sized>: ArchiveUnsized {
    // Required method
    fn serialize_unsized(&self, serializer: &mut S) -> Result<usize, S::Error>;
}
Expand description

A counterpart of Serialize that’s suitable for unsized types.

See ArchiveUnsized for examples of implementing SerializeUnsized.

Required Methods§

Source

fn serialize_unsized(&self, serializer: &mut S) -> Result<usize, S::Error>

Writes the object and returns the position of the archived type.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<S: Fallible + Writer + ?Sized> SerializeUnsized<S> for CStr

Source§

fn serialize_unsized(&self, serializer: &mut S) -> Result<usize, S::Error>

Source§

impl<S: Fallible + Writer + ?Sized> SerializeUnsized<S> for str

Source§

fn serialize_unsized(&self, serializer: &mut S) -> Result<usize, S::Error>

Source§

impl<T, S> SerializeUnsized<S> for [T]
where T: Serialize<S>, S: Fallible + Allocator + Writer + ?Sized,

Source§

fn serialize_unsized(&self, serializer: &mut S) -> Result<usize, S::Error>

Implementors§

Source§

impl<T, S> SerializeUnsized<S> for T
where T: Serialize<S>, S: Fallible + Writer + ?Sized,