Trait s2n_codec::encoder::value::EncoderValue
source · pub trait EncoderValue: Sized {
// Required method
fn encode<E: Encoder>(&self, encoder: &mut E);
// Provided methods
fn encode_mut<E: Encoder>(&mut self, encoder: &mut E) { ... }
fn encoding_size(&self) -> usize { ... }
fn encoding_size_for_encoder<E: Encoder>(&self, encoder: &E) -> usize { ... }
fn encode_with_len_prefix<Len: TryFrom<usize> + EncoderValue, E: Encoder>(
&self,
encoder: &mut E
)
where Self: Sized,
Len::Error: Debug { ... }
}
Required Methods§
Provided Methods§
sourcefn encode_mut<E: Encoder>(&mut self, encoder: &mut E)
fn encode_mut<E: Encoder>(&mut self, encoder: &mut E)
Encodes the value into the encoder, while potentially mutating the value itself
sourcefn encoding_size(&self) -> usize
fn encoding_size(&self) -> usize
Returns the encoding size with no buffer constrains
sourcefn encoding_size_for_encoder<E: Encoder>(&self, encoder: &E) -> usize
fn encoding_size_for_encoder<E: Encoder>(&self, encoder: &E) -> usize
Returns the encoding size for the given encoder’s capacity
sourcefn encode_with_len_prefix<Len: TryFrom<usize> + EncoderValue, E: Encoder>(
&self,
encoder: &mut E
)where
Self: Sized,
Len::Error: Debug,
fn encode_with_len_prefix<Len: TryFrom<usize> + EncoderValue, E: Encoder>( &self, encoder: &mut E )where Self: Sized, Len::Error: Debug,
Encodes the value into the encoder with a prefix of Len