Struct rkyv::ser::serializers::AlignedSerializer
source · [−]pub struct AlignedSerializer<A> { /* private fields */ }
Expand description
A serializer made specifically to work with AlignedVec
.
This serializer makes it easier for the compiler to perform emplacement optimizations and may
give better performance than a basic WriteSerializer
.
Implementations
sourceimpl<A: Borrow<AlignedVec>> AlignedSerializer<A>
impl<A: Borrow<AlignedVec>> AlignedSerializer<A>
sourcepub fn into_inner(self) -> A
pub fn into_inner(self) -> A
Consumes the serializer and returns the underlying type.
Trait Implementations
sourceimpl<A: Debug> Debug for AlignedSerializer<A>
impl<A: Debug> Debug for AlignedSerializer<A>
sourceimpl<A: Default> Default for AlignedSerializer<A>
impl<A: Default> Default for AlignedSerializer<A>
sourceimpl<A> Fallible for AlignedSerializer<A>
impl<A> Fallible for AlignedSerializer<A>
type Error = Infallible
type Error = Infallible
The error produced by any failing methods.
sourceimpl<A: Borrow<AlignedVec> + BorrowMut<AlignedVec>> Serializer for AlignedSerializer<A>
impl<A: Borrow<AlignedVec> + BorrowMut<AlignedVec>> Serializer for AlignedSerializer<A>
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.
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 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.
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<A> RefUnwindSafe for AlignedSerializer<A> where
A: RefUnwindSafe,
impl<A> Send for AlignedSerializer<A> where
A: Send,
impl<A> Sync for AlignedSerializer<A> where
A: Sync,
impl<A> Unpin for AlignedSerializer<A> where
A: Unpin,
impl<A> UnwindSafe for AlignedSerializer<A> where
A: 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(_: &Self::ArchivedMetadata) -> <Self as Pointee>::Metadata
fn pointer_metadata(_: &Self::ArchivedMetadata) -> <Self 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 · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more