Struct rkyv_test::ser::serializers::CompositeSerializer
source · [−]pub struct CompositeSerializer<S = Infallible, C = Infallible, H = Infallible> { /* private fields */ }Expand description
A serializer built from composeable pieces.
Implementations
sourceimpl<S, C, H> CompositeSerializer<S, C, H>
impl<S, C, H> CompositeSerializer<S, C, H>
sourcepub fn new(serializer: S, scratch: C, shared: H) -> Self
pub fn new(serializer: S, scratch: C, shared: H) -> Self
Creates a new composite serializer from serializer, scratch, and shared components.
sourcepub fn into_components(self) -> (S, C, H)
pub fn into_components(self) -> (S, C, H)
Consumes the composite serializer and returns the components.
sourcepub fn into_serializer(self) -> S
pub fn into_serializer(self) -> S
Consumes the composite serializer and returns the serializer.
The scratch space and shared component are discarded.
Trait Implementations
sourceimpl<S: Fallible, C: ScratchSpace, H: Fallible> ScratchSpace for CompositeSerializer<S, C, H>
impl<S: Fallible, C: ScratchSpace, H: Fallible> ScratchSpace for CompositeSerializer<S, C, H>
sourceimpl<S: Serializer, C: Fallible, H: Fallible> Serializer for CompositeSerializer<S, C, H>
impl<S: Serializer, C: Fallible, H: Fallible> Serializer for CompositeSerializer<S, C, H>
sourcefn write(&mut self, bytes: &[u8]) -> Result<(), Self::Error>
fn write(&mut self, bytes: &[u8]) -> Result<(), Self::Error>
Attempts to write the given bytes to the serializer.
sourcefn pad(&mut self, padding: usize) -> Result<(), Self::Error>
fn pad(&mut self, padding: usize) -> Result<(), Self::Error>
Advances the given number of bytes as padding.
sourcefn align(&mut self, align: usize) -> Result<usize, Self::Error>
fn align(&mut self, align: usize) -> Result<usize, Self::Error>
Aligns the position of the serializer to the given alignment.
sourcefn align_for<T>(&mut self) -> Result<usize, Self::Error>
fn align_for<T>(&mut self) -> Result<usize, Self::Error>
Aligns the position of the serializer to be suitable to write the given type.
sourceunsafe fn resolve_aligned<T: Archive + ?Sized>(
&mut self,
value: &T,
resolver: T::Resolver
) -> Result<usize, Self::Error>
unsafe fn resolve_aligned<T: Archive + ?Sized>(
&mut self,
value: &T,
resolver: T::Resolver
) -> Result<usize, Self::Error>
Resolves the given value with its resolver and writes the archived type. Read more
sourceunsafe fn resolve_unsized_aligned<T: ArchiveUnsized + ?Sized>(
&mut self,
value: &T,
to: usize,
metadata_resolver: T::MetadataResolver
) -> Result<usize, Self::Error>
unsafe fn resolve_unsized_aligned<T: ArchiveUnsized + ?Sized>(
&mut self,
value: &T,
to: usize,
metadata_resolver: T::MetadataResolver
) -> Result<usize, Self::Error>
Resolves the given reference with its resolver and writes the archived reference. Read more
sourcefn serialize_value<T: Serialize<Self>>(
&mut self,
value: &T
) -> Result<usize, Self::Error>
fn serialize_value<T: Serialize<Self>>(
&mut self,
value: &T
) -> Result<usize, Self::Error>
Archives the given object and returns the position it was archived at.
sourcefn serialize_unsized_value<T: SerializeUnsized<Self> + ?Sized>(
&mut self,
value: &T
) -> Result<usize, Self::Error>
fn serialize_unsized_value<T: SerializeUnsized<Self> + ?Sized>(
&mut self,
value: &T
) -> Result<usize, Self::Error>
Archives a reference to the given object and returns the position it was archived at.
Auto Trait Implementations
impl<S, C, H> RefUnwindSafe for CompositeSerializer<S, C, H> where
C: RefUnwindSafe,
H: RefUnwindSafe,
S: RefUnwindSafe,
impl<S, C, H> Send for CompositeSerializer<S, C, H> where
C: Send,
H: Send,
S: Send,
impl<S, C, H> Sync for CompositeSerializer<S, C, H> where
C: Sync,
H: Sync,
S: Sync,
impl<S, C, H> Unpin for CompositeSerializer<S, C, H> where
C: Unpin,
H: Unpin,
S: Unpin,
impl<S, C, H> UnwindSafe for CompositeSerializer<S, C, H> where
C: UnwindSafe,
H: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
sourceimpl<T> ArchivePointee for T
impl<T> ArchivePointee for T
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
sourcefn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more