Trait rkyv::Serialize[][src]

pub trait Serialize<S: Fallible + ?Sized>: Archive {
    fn serialize(&self, serializer: &mut S) -> Result<Self::Resolver, S::Error>;
}
Expand description

Converts a type to its archived form.

Objects perform any supportive serialization during serialize. For types that reference nonlocal (pointed-to) data, this is when that data must be serialized to the output. These types will need to bound S to implement Serializer and any other required traits (e.g. SharedSerializeRegistry). They should then serialize their dependencies during serialize.

See Archive for examples of implementing Serialize.

Required methods

Writes the dependencies for the object and returns a resolver that can create the archived type.

Implementations on Foreign Types

Implementors