Struct rkyv::ser::adapters::SharedSerializerAdapter[][src]

pub struct SharedSerializerAdapter<S> { /* fields omitted */ }

An adapter that adds shared serialization support to a serializer.

Implementations

impl<S> SharedSerializerAdapter<S>[src]

pub fn new(inner: S) -> Self[src]

Wraps the given serializer and adds shared memory support.

pub fn into_inner(self) -> S[src]

Consumes the adapter and returns the underlying serializer.

Trait Implementations

impl<S: Fallible> Fallible for SharedSerializerAdapter<S>[src]

type Error = S::Error

The error produced by any failing methods

impl<S: Serializer> Serializer for SharedSerializerAdapter<S>[src]

fn pos(&self) -> usize[src]

Returns the current position of the serializer.

fn write(&mut self, bytes: &[u8]) -> Result<(), Self::Error>[src]

Attempts to write the given bytes to the serializer.

fn pad(&mut self, padding: usize) -> Result<(), Self::Error>[src]

Advances the given number of bytes as padding.

fn align(&mut self, align: usize) -> Result<usize, Self::Error>[src]

Aligns the position of the serializer to the given alignment.

fn align_for<T>(&mut self) -> Result<usize, Self::Error>[src]

Aligns the position of the serializer to be suitable to write the given type.

unsafe fn resolve_aligned<T: Archive + ?Sized>(
    &mut self,
    value: &T,
    resolver: T::Resolver
) -> Result<usize, Self::Error>
[src]

Resolves the given value with its resolver and writes the archived type. Read more

fn serialize_value<T: Serialize<Self>>(
    &mut self,
    value: &T
) -> Result<usize, Self::Error>
[src]

Archives the given object and returns the position it was archived at.

unsafe fn resolve_unsized_aligned<T: ArchiveUnsized + ?Sized>(
    &mut self,
    value: &T,
    to: usize,
    metadata_resolver: T::MetadataResolver
) -> Result<usize, Self::Error>
[src]

Resolves the given reference with its resolver and writes the archived reference. Read more

fn serialize_unsized_value<T: SerializeUnsized<Self> + ?Sized>(
    &mut self,
    value: &T
) -> Result<usize, Self::Error>
[src]

Archives a reference to the given object and returns the position it was archived at.

impl<S: Serializer> SharedSerializer for SharedSerializerAdapter<S>[src]

fn serialize_shared<T: SerializeUnsized<Self> + ?Sized>(
    &mut self,
    value: &T
) -> Result<usize, Self::Error>
[src]

Archives the given shared value and returns its position. If the value has already been serialized then it returns the position of the previously serialized value. Read more

Auto Trait Implementations

impl<S> RefUnwindSafe for SharedSerializerAdapter<S> where
    S: RefUnwindSafe

impl<S> !Send for SharedSerializerAdapter<S>

impl<S> !Sync for SharedSerializerAdapter<S>

impl<S> Unpin for SharedSerializerAdapter<S> where
    S: Unpin

impl<S> UnwindSafe for SharedSerializerAdapter<S> where
    S: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> ArchivePointee for T[src]

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.

pub fn pointer_metadata(
    &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
[src]

Converts some archived metadata to the pointer metadata for itself.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Pointee for T[src]

type Metadata = ()

The type for metadata in pointers and references to Self.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.