pub trait PacketPayloadEncoder {
// Required methods
fn encoding_size_hint<E: Encoder>(
&mut self,
encoder: &E,
minimum_len: usize,
) -> usize;
fn encode(
&mut self,
buffer: &mut Buffer<'_>,
minimum_len: usize,
header_len: usize,
tag_len: usize,
);
}Required Methods§
Sourcefn encoding_size_hint<E: Encoder>(
&mut self,
encoder: &E,
minimum_len: usize,
) -> usize
fn encoding_size_hint<E: Encoder>( &mut self, encoder: &E, minimum_len: usize, ) -> usize
Returns an estimate of the encoding size of the payload. This may be inaccurate from what actually is encoded. Estimates should be less than or equal to what is actually written. Implementations can return 0 to skip encoding.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.