pub struct EncoderLenEstimator { /* private fields */ }
Expand description
Estimates the encoding_size
of an EncoderValue
Implementations§
Trait Implementations§
Source§impl Encoder for EncoderLenEstimator
impl Encoder for EncoderLenEstimator
Source§fn write_sized<F: FnOnce(&mut [u8])>(&mut self, len: usize, _write: F)
fn write_sized<F: FnOnce(&mut [u8])>(&mut self, len: usize, _write: F)
Calls
write
with a slice of len
bytes at the current write positionSource§fn write_slice(&mut self, slice: &[u8])
fn write_slice(&mut self, slice: &[u8])
Copies the slice into the buffer
Source§fn write_repeated(&mut self, count: usize, _value: u8)
fn write_repeated(&mut self, count: usize, _value: u8)
Source§fn write_zerocopy<T: FromBytes + Unaligned, F: FnOnce(&mut T)>(
&mut self,
_write: F,
)
fn write_zerocopy<T: FromBytes + Unaligned, F: FnOnce(&mut T)>( &mut self, _write: F, )
Writes a zerocopy value to the buffer
Source§const SPECIALIZES_BYTES: bool = false
const SPECIALIZES_BYTES: bool = false
Set to
true
if the particular encoder specializes on the bytes implementationSource§fn encode<T: EncoderValue>(&mut self, value: &T)
fn encode<T: EncoderValue>(&mut self, value: &T)
Encode the given
EncoderValue
into the bufferSource§fn encode_with_len_prefix<Len: TryFrom<usize> + EncoderValue, T: EncoderValue>(
&mut self,
value: &T,
)
fn encode_with_len_prefix<Len: TryFrom<usize> + EncoderValue, T: EncoderValue>( &mut self, value: &T, )
Encode the given
EncoderValue
into the buffer with a prefix of Len
fn write_bytes(&mut self, bytes: Bytes)
Source§fn remaining_capacity(&self) -> usize
fn remaining_capacity(&self) -> usize
Returns the number of available bytes in the buffer
Auto Trait Implementations§
impl Freeze for EncoderLenEstimator
impl RefUnwindSafe for EncoderLenEstimator
impl Send for EncoderLenEstimator
impl Sync for EncoderLenEstimator
impl Unpin for EncoderLenEstimator
impl UnwindSafe for EncoderLenEstimator
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