pub struct RecordsSerializer<'a, S, R: 'a, I>{ /* private fields */ }
Expand description
An instance of records serialization.
RecordsSerializer
is instantiated with an Iterator
that provides
items to be serialized by a RecordsSerializerImpl
.
Implementations§
Source§impl<'a, S, R: 'a, I> RecordsSerializer<'a, S, R, I>
impl<'a, S, R: 'a, I> RecordsSerializer<'a, S, R, I>
Sourcepub fn new(records: I) -> Self
pub fn new(records: I) -> Self
Creates a new RecordsSerializer
with given records
.
records
must produce the same sequence of values from every iterator,
even if cloned. Serialization typically performed with two passes on
records
: one to calculate the total length in bytes
(records_bytes_len
) and another one to serialize to a buffer
(serialize_records
). Violating this rule may cause panics or malformed
packets.
Trait Implementations§
Source§impl<'a, S, R: Debug + 'a, I> Debug for RecordsSerializer<'a, S, R, I>
impl<'a, S, R: Debug + 'a, I> Debug for RecordsSerializer<'a, S, R, I>
Source§impl<'a, S, R: 'a, I> InnerPacketBuilder for RecordsSerializer<'a, S, R, I>
impl<'a, S, R: 'a, I> InnerPacketBuilder for RecordsSerializer<'a, S, R, I>
Source§fn serialize(&self, buffer: &mut [u8])
fn serialize(&self, buffer: &mut [u8])
Serializes this packet into an existing buffer. Read more
§fn into_serializer(self) -> InnerSerializer<Self, EmptyBuf>where
Self: Sized,
fn into_serializer(self) -> InnerSerializer<Self, EmptyBuf>where
Self: Sized,
§fn into_serializer_with<B>(self, buffer: B) -> InnerSerializer<Self, B>where
B: ShrinkBuffer,
Self: Sized,
fn into_serializer_with<B>(self, buffer: B) -> InnerSerializer<Self, B>where
B: ShrinkBuffer,
Self: Sized,
Converts this
InnerPacketBuilder
into a [Serializer
] with a buffer
that can be used for serialization. Read moreAuto Trait Implementations§
impl<'a, S, R, I> Freeze for RecordsSerializer<'a, S, R, I>where
I: Freeze,
impl<'a, S, R, I> RefUnwindSafe for RecordsSerializer<'a, S, R, I>where
I: RefUnwindSafe,
S: RefUnwindSafe,
impl<'a, S, R, I> Send for RecordsSerializer<'a, S, R, I>
impl<'a, S, R, I> Sync for RecordsSerializer<'a, S, R, I>
impl<'a, S, R, I> Unpin for RecordsSerializer<'a, S, R, I>
impl<'a, S, R, I> UnwindSafe for RecordsSerializer<'a, S, R, I>where
I: UnwindSafe,
S: 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