Trait rkyv::SerializeUnsized [−][src]
pub trait SerializeUnsized<S: Fallible + ?Sized>: ArchiveUnsized { fn serialize_unsized(&self, serializer: &mut S) -> Result<usize, S::Error>; fn serialize_metadata(
&self,
serializer: &mut S
) -> Result<Self::MetadataResolver, S::Error>; }
A counterpart of Serialize
that’s suitable for unsized types.
See ArchiveUnsized
for examples of implementing SerializeUnsized
.
Required methods
fn serialize_unsized(&self, serializer: &mut S) -> Result<usize, S::Error>
[src]
Writes the object and returns the position of the archived type.
fn serialize_metadata(
&self,
serializer: &mut S
) -> Result<Self::MetadataResolver, S::Error>
[src]
&self,
serializer: &mut S
) -> Result<Self::MetadataResolver, S::Error>
Serializes the metadata for the given type.
Implementations on Foreign Types
impl<T: Serialize<S>, S: Serializer + ?Sized> SerializeUnsized<S> for [T]
[src]
impl<T: Serialize<S>, S: Serializer + ?Sized> SerializeUnsized<S> for [T]
[src]fn serialize_unsized(&self, serializer: &mut S) -> Result<usize, S::Error>
[src]
fn serialize_metadata(
&self,
_: &mut S
) -> Result<Self::MetadataResolver, S::Error>
[src]
&self,
_: &mut S
) -> Result<Self::MetadataResolver, S::Error>
impl<S: Serializer + ?Sized> SerializeUnsized<S> for str
[src]
impl<S: Serializer + ?Sized> SerializeUnsized<S> for str
[src]fn serialize_unsized(&self, serializer: &mut S) -> Result<usize, S::Error>
[src]
fn serialize_metadata(
&self,
_: &mut S
) -> Result<Self::MetadataResolver, S::Error>
[src]
&self,
_: &mut S
) -> Result<Self::MetadataResolver, S::Error>
Implementors
impl<T: Serialize<S>, S: Serializer + ?Sized> SerializeUnsized<S> for T
[src]
impl<T: Serialize<S>, S: Serializer + ?Sized> SerializeUnsized<S> for T
[src]fn serialize_unsized(&self, serializer: &mut S) -> Result<usize, S::Error>
[src]
fn serialize_metadata(
&self,
_: &mut S
) -> Result<ArchivedMetadata<Self>, S::Error>
[src]
&self,
_: &mut S
) -> Result<ArchivedMetadata<Self>, S::Error>