Struct packet::serialize::InnerSerializer
source · pub struct InnerSerializer<I, B> { /* private fields */ }
Expand description
A Serializer
constructed from an InnerPacketBuilder
.
An InnerSerializer
wraps an InnerPacketBuilder
and a buffer, and
implements the Serializer
trait. When a serialization is requested, it
either reuses the stored buffer or allocates a new one large enough to hold
itself and all outer PacketBuilder
s.
Implementations§
Trait Implementations§
source§impl<I: Clone, B: Clone> Clone for InnerSerializer<I, B>
impl<I: Clone, B: Clone> Clone for InnerSerializer<I, B>
source§fn clone(&self) -> InnerSerializer<I, B>
fn clone(&self) -> InnerSerializer<I, B>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<I: PartialEq, B: PartialEq> PartialEq for InnerSerializer<I, B>
impl<I: PartialEq, B: PartialEq> PartialEq for InnerSerializer<I, B>
source§fn eq(&self, other: &InnerSerializer<I, B>) -> bool
fn eq(&self, other: &InnerSerializer<I, B>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<I: InnerPacketBuilder, B: GrowBuffer + ShrinkBuffer> Serializer for InnerSerializer<I, B>
impl<I: InnerPacketBuilder, B: GrowBuffer + ShrinkBuffer> Serializer for InnerSerializer<I, B>
source§fn serialize<BB: GrowBufferMut, P: BufferProvider<B, BB>>(
self,
outer: PacketConstraints,
provider: P,
) -> Result<BB, (SerializeError<P::Error>, InnerSerializer<I, B>)>
fn serialize<BB: GrowBufferMut, P: BufferProvider<B, BB>>( self, outer: PacketConstraints, provider: P, ) -> Result<BB, (SerializeError<P::Error>, InnerSerializer<I, B>)>
Serializes this
Serializer
, producing a buffer. Read moresource§fn serialize_new_buf<BB: ReusableBuffer, A: BufferAlloc<BB>>(
&self,
outer: PacketConstraints,
alloc: A,
) -> Result<BB, SerializeError<A::Error>>
fn serialize_new_buf<BB: ReusableBuffer, A: BufferAlloc<BB>>( &self, outer: PacketConstraints, alloc: A, ) -> Result<BB, SerializeError<A::Error>>
Serializes the data into a new buffer without consuming
self
. Read moresource§fn serialize_outer<B: GrowBufferMut, P: BufferProvider<Self::Buffer, B>>(
self,
provider: P,
) -> Result<B, (SerializeError<P::Error>, Self)>
fn serialize_outer<B: GrowBufferMut, P: BufferProvider<Self::Buffer, B>>( self, provider: P, ) -> Result<B, (SerializeError<P::Error>, Self)>
Serializes this
Serializer
as the outermost packet. Read moresource§fn encapsulate<B>(self, outer: B) -> Nested<Self, B>
fn encapsulate<B>(self, outer: B) -> Nested<Self, B>
source§fn with_size_limit(self, limit: usize) -> Nested<Self, LimitedSizePacketBuilder>
fn with_size_limit(self, limit: usize) -> Nested<Self, LimitedSizePacketBuilder>
Creates a new
Serializer
which will enforce a size limit. Read moreimpl<I: Copy, B: Copy> Copy for InnerSerializer<I, B>
impl<I: Eq, B: Eq> Eq for InnerSerializer<I, B>
impl<I, B> StructuralPartialEq for InnerSerializer<I, B>
Auto Trait Implementations§
impl<I, B> Freeze for InnerSerializer<I, B>
impl<I, B> RefUnwindSafe for InnerSerializer<I, B>where
I: RefUnwindSafe,
B: RefUnwindSafe,
impl<I, B> Send for InnerSerializer<I, B>
impl<I, B> Sync for InnerSerializer<I, B>
impl<I, B> Unpin for InnerSerializer<I, B>
impl<I, B> UnwindSafe for InnerSerializer<I, B>where
I: UnwindSafe,
B: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)