pub trait EncoderValue: Sized {
    // Required method
    fn encode<E>(&self, encoder: &mut E)
       where E: Encoder;

    // Provided methods
    fn encode_mut<E>(&mut self, encoder: &mut E)
       where E: Encoder { ... }
    fn encoding_size(&self) -> usize { ... }
    fn encoding_size_for_encoder<E>(&self, encoder: &E) -> usize
       where E: Encoder { ... }
    fn encode_with_len_prefix<Len, E>(&self, encoder: &mut E)
       where Len: TryFrom<usize> + EncoderValue,
             E: Encoder,
             Self: Sized,
             <Len as TryFrom<usize>>::Error: Debug { ... }
    fn encode_to_vec(&self) -> Vec<u8> { ... }
}

Required Methods§

source

fn encode<E>(&self, encoder: &mut E)where E: Encoder,

Encodes the value into the encoder

Provided Methods§

source

fn encode_mut<E>(&mut self, encoder: &mut E)where E: Encoder,

Encodes the value into the encoder, while potentially mutating the value itself

source

fn encoding_size(&self) -> usize

Returns the encoding size with no buffer constrains

source

fn encoding_size_for_encoder<E>(&self, encoder: &E) -> usizewhere E: Encoder,

Returns the encoding size for the given encoder’s capacity

source

fn encode_with_len_prefix<Len, E>(&self, encoder: &mut E)where Len: TryFrom<usize> + EncoderValue, E: Encoder, Self: Sized, <Len as TryFrom<usize>>::Error: Debug,

Encodes the value into the encoder with a prefix of Len

source

fn encode_to_vec(&self) -> Vec<u8>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl EncoderValue for &[&[u8]]

source§

fn encode<E>(&self, encoder: &mut E)where E: Encoder,

source§

fn encoding_size(&self) -> usize

source§

fn encoding_size_for_encoder<E>(&self, _encoder: &E) -> usizewhere E: Encoder,

source§

impl EncoderValue for &[u8]

source§

fn encode<E>(&self, encoder: &mut E)where E: Encoder,

source§

fn encoding_size(&self) -> usize

source§

fn encoding_size_for_encoder<E>(&self, _encoder: &E) -> usizewhere E: Encoder,

source§

impl EncoderValue for &mut [u8]

source§

fn encode<E>(&self, encoder: &mut E)where E: Encoder,

source§

fn encoding_size(&self) -> usize

source§

fn encoding_size_for_encoder<E>(&self, _encoder: &E) -> usizewhere E: Encoder,

source§

impl EncoderValue for f32

source§

fn encode<E>(&self, encoder: &mut E)where E: Encoder,

source§

fn encoding_size(&self) -> usize

source§

fn encoding_size_for_encoder<E>(&self, _encoder: &E) -> usizewhere E: Encoder,

source§

impl EncoderValue for f64

source§

fn encode<E>(&self, encoder: &mut E)where E: Encoder,

source§

fn encoding_size(&self) -> usize

source§

fn encoding_size_for_encoder<E>(&self, _encoder: &E) -> usizewhere E: Encoder,

source§

impl EncoderValue for i8

source§

fn encode<E>(&self, encoder: &mut E)where E: Encoder,

source§

fn encoding_size(&self) -> usize

source§

fn encoding_size_for_encoder<E>(&self, _encoder: &E) -> usizewhere E: Encoder,

source§

impl EncoderValue for i16

source§

fn encode<E>(&self, encoder: &mut E)where E: Encoder,

source§

fn encoding_size(&self) -> usize

source§

fn encoding_size_for_encoder<E>(&self, _encoder: &E) -> usizewhere E: Encoder,

source§

impl EncoderValue for i32

source§

fn encode<E>(&self, encoder: &mut E)where E: Encoder,

source§

fn encoding_size(&self) -> usize

source§

fn encoding_size_for_encoder<E>(&self, _encoder: &E) -> usizewhere E: Encoder,

source§

impl EncoderValue for i64

source§

fn encode<E>(&self, encoder: &mut E)where E: Encoder,

source§

fn encoding_size(&self) -> usize

source§

fn encoding_size_for_encoder<E>(&self, _encoder: &E) -> usizewhere E: Encoder,

source§

impl EncoderValue for i128

source§

fn encode<E>(&self, encoder: &mut E)where E: Encoder,

source§

fn encoding_size(&self) -> usize

source§

fn encoding_size_for_encoder<E>(&self, _encoder: &E) -> usizewhere E: Encoder,

source§

impl EncoderValue for u8

source§

fn encode<E>(&self, encoder: &mut E)where E: Encoder,

source§

fn encoding_size(&self) -> usize

source§

fn encoding_size_for_encoder<E>(&self, _encoder: &E) -> usizewhere E: Encoder,

source§

impl EncoderValue for u16

source§

fn encode<E>(&self, encoder: &mut E)where E: Encoder,

source§

fn encoding_size(&self) -> usize

source§

fn encoding_size_for_encoder<E>(&self, _encoder: &E) -> usizewhere E: Encoder,

source§

impl EncoderValue for u32

source§

fn encode<E>(&self, encoder: &mut E)where E: Encoder,

source§

fn encoding_size(&self) -> usize

source§

fn encoding_size_for_encoder<E>(&self, _encoder: &E) -> usizewhere E: Encoder,

source§

impl EncoderValue for u64

source§

fn encode<E>(&self, encoder: &mut E)where E: Encoder,

source§

fn encoding_size(&self) -> usize

source§

fn encoding_size_for_encoder<E>(&self, _encoder: &E) -> usizewhere E: Encoder,

source§

impl EncoderValue for u128

source§

fn encode<E>(&self, encoder: &mut E)where E: Encoder,

source§

fn encoding_size(&self) -> usize

source§

fn encoding_size_for_encoder<E>(&self, _encoder: &E) -> usizewhere E: Encoder,

source§

impl EncoderValue for ()

source§

fn encode<E>(&self, _encoder: &mut E)where E: Encoder,

source§

fn encoding_size(&self) -> usize

source§

fn encoding_size_for_encoder<E>(&self, _encoder: &E) -> usizewhere E: Encoder,

source§

impl<T> EncoderValue for Option<T>where T: EncoderValue,

source§

fn encode<E>(&self, buffer: &mut E)where E: Encoder,

source§

fn encode_mut<E>(&mut self, buffer: &mut E)where E: Encoder,

Implementors§

source§

impl EncoderValue for InitialId

source§

impl EncoderValue for LocalId

source§

impl EncoderValue for PeerId

source§

impl EncoderValue for UnboundedId

source§

impl EncoderValue for HandshakeHeaderwhere HandshakeHeader: AsBytes,

source§

impl EncoderValue for EcnCounts

source§

impl EncoderValue for DataBlocked

source§

impl EncoderValue for HandshakeDone

source§

impl EncoderValue for MaxData

source§

impl EncoderValue for MaxStreamData

source§

impl EncoderValue for MaxStreams

source§

impl EncoderValue for Padding

source§

impl EncoderValue for Ping

source§

impl EncoderValue for ResetStream

source§

impl EncoderValue for RetireConnectionId

source§

impl EncoderValue for StopSending

source§

impl EncoderValue for StreamDataBlocked

source§

impl EncoderValue for StreamsBlocked

source§

impl EncoderValue for EtherTypewhere EtherType: AsBytes,

source§

impl EncoderValue for s2n_quic_core::inet::ethernet::Headerwhere Header: AsBytes,

source§

impl EncoderValue for MacAddresswhere MacAddress: AsBytes,

source§

impl EncoderValue for Protocolwhere Protocol: AsBytes,

source§

impl EncoderValue for FlagFragmentwhere FlagFragment: AsBytes,

source§

impl EncoderValue for s2n_quic_core::inet::ipv4::Headerwhere Header: AsBytes,

source§

impl EncoderValue for IpV4Addresswhere IpV4Address: AsBytes,

source§

impl EncoderValue for SocketAddressV4where SocketAddressV4: AsBytes,

source§

impl EncoderValue for Toswhere Tos: AsBytes,

source§

impl EncoderValue for Vihlwhere Vihl: AsBytes,

source§

impl EncoderValue for s2n_quic_core::inet::ipv6::Headerwhere Header: AsBytes,

source§

impl EncoderValue for IpV6Addresswhere IpV6Address: AsBytes,

source§

impl EncoderValue for SocketAddressV6where SocketAddressV6: AsBytes,

source§

impl EncoderValue for Vtcflwhere Vtcfl: AsBytes,

source§

impl EncoderValue for s2n_quic_core::inet::udp::Headerwhere Header: AsBytes,

source§

impl EncoderValue for DecoderBufferMut<'_>

source§

impl EncoderValue for TruncatedPacketNumber

source§

impl EncoderValue for Token

source§

impl EncoderValue for InitialSourceConnectionId

source§

impl EncoderValue for OriginalDestinationConnectionId

source§

impl EncoderValue for PreferredAddress

source§

impl EncoderValue for RetrySourceConnectionId

source§

impl EncoderValue for VarInt

source§

impl EncoderValue for DecoderBuffer<'_>

source§

impl EncoderValue for i24

source§

impl EncoderValue for i48

source§

impl EncoderValue for u24

source§

impl EncoderValue for u48

source§

impl EncoderValue for I16where I16: AsBytes,

source§

impl EncoderValue for I32where I32: AsBytes,

source§

impl EncoderValue for I64where I64: AsBytes,

source§

impl EncoderValue for I128where I128: AsBytes,

source§

impl EncoderValue for U16where U16: AsBytes,

source§

impl EncoderValue for U32where U32: AsBytes,

source§

impl EncoderValue for U64where U64: AsBytes,

source§

impl EncoderValue for U128where U128: AsBytes,

source§

impl<'a> EncoderValue for &'a HandshakeHeaderwhere HandshakeHeader: AsBytes,

source§

impl<'a> EncoderValue for &'a EtherTypewhere EtherType: AsBytes,

source§

impl<'a> EncoderValue for &'a s2n_quic_core::inet::ethernet::Headerwhere Header: AsBytes,

source§

impl<'a> EncoderValue for &'a MacAddresswhere MacAddress: AsBytes,

source§

impl<'a> EncoderValue for &'a Protocolwhere Protocol: AsBytes,

source§

impl<'a> EncoderValue for &'a FlagFragmentwhere FlagFragment: AsBytes,

source§

impl<'a> EncoderValue for &'a s2n_quic_core::inet::ipv4::Headerwhere Header: AsBytes,

source§

impl<'a> EncoderValue for &'a IpV4Addresswhere IpV4Address: AsBytes,

source§

impl<'a> EncoderValue for &'a SocketAddressV4where SocketAddressV4: AsBytes,

source§

impl<'a> EncoderValue for &'a Toswhere Tos: AsBytes,

source§

impl<'a> EncoderValue for &'a Vihlwhere Vihl: AsBytes,

source§

impl<'a> EncoderValue for &'a s2n_quic_core::inet::ipv6::Headerwhere Header: AsBytes,

source§

impl<'a> EncoderValue for &'a IpV6Addresswhere IpV6Address: AsBytes,

source§

impl<'a> EncoderValue for &'a SocketAddressV6where SocketAddressV6: AsBytes,

source§

impl<'a> EncoderValue for &'a Vtcflwhere Vtcfl: AsBytes,

source§

impl<'a> EncoderValue for &'a s2n_quic_core::inet::udp::Headerwhere Header: AsBytes,

source§

impl<'a> EncoderValue for &'a I16where I16: AsBytes,

source§

impl<'a> EncoderValue for &'a I32where I32: AsBytes,

source§

impl<'a> EncoderValue for &'a I64where I64: AsBytes,

source§

impl<'a> EncoderValue for &'a I128where I128: AsBytes,

source§

impl<'a> EncoderValue for &'a U16where U16: AsBytes,

source§

impl<'a> EncoderValue for &'a U32where U32: AsBytes,

source§

impl<'a> EncoderValue for &'a U64where U64: AsBytes,

source§

impl<'a> EncoderValue for &'a U128where U128: AsBytes,

source§

impl<'a> EncoderValue for &'a mut HandshakeHeaderwhere HandshakeHeader: AsBytes,

source§

impl<'a> EncoderValue for &'a mut EtherTypewhere EtherType: AsBytes,

source§

impl<'a> EncoderValue for &'a mut s2n_quic_core::inet::ethernet::Headerwhere Header: AsBytes,

source§

impl<'a> EncoderValue for &'a mut MacAddresswhere MacAddress: AsBytes,

source§

impl<'a> EncoderValue for &'a mut Protocolwhere Protocol: AsBytes,

source§

impl<'a> EncoderValue for &'a mut FlagFragmentwhere FlagFragment: AsBytes,

source§

impl<'a> EncoderValue for &'a mut s2n_quic_core::inet::ipv4::Headerwhere Header: AsBytes,

source§

impl<'a> EncoderValue for &'a mut IpV4Addresswhere IpV4Address: AsBytes,

source§

impl<'a> EncoderValue for &'a mut SocketAddressV4where SocketAddressV4: AsBytes,

source§

impl<'a> EncoderValue for &'a mut Toswhere Tos: AsBytes,

source§

impl<'a> EncoderValue for &'a mut Vihlwhere Vihl: AsBytes,

source§

impl<'a> EncoderValue for &'a mut s2n_quic_core::inet::ipv6::Headerwhere Header: AsBytes,

source§

impl<'a> EncoderValue for &'a mut IpV6Addresswhere IpV6Address: AsBytes,

source§

impl<'a> EncoderValue for &'a mut SocketAddressV6where SocketAddressV6: AsBytes,

source§

impl<'a> EncoderValue for &'a mut Vtcflwhere Vtcfl: AsBytes,

source§

impl<'a> EncoderValue for &'a mut s2n_quic_core::inet::udp::Headerwhere Header: AsBytes,

source§

impl<'a> EncoderValue for &'a mut I16where I16: AsBytes,

source§

impl<'a> EncoderValue for &'a mut I32where I32: AsBytes,

source§

impl<'a> EncoderValue for &'a mut I64where I64: AsBytes,

source§

impl<'a> EncoderValue for &'a mut I128where I128: AsBytes,

source§

impl<'a> EncoderValue for &'a mut U16where U16: AsBytes,

source§

impl<'a> EncoderValue for &'a mut U32where U32: AsBytes,

source§

impl<'a> EncoderValue for &'a mut U64where U64: AsBytes,

source§

impl<'a> EncoderValue for &'a mut U128where U128: AsBytes,

source§

impl<'a> EncoderValue for ConnectionClose<'a>

source§

impl<'a> EncoderValue for NewConnectionId<'a>

source§

impl<'a> EncoderValue for NewToken<'a>

source§

impl<'a> EncoderValue for PathChallenge<'a>

source§

impl<'a> EncoderValue for PathResponse<'a>

source§

impl<'a> EncoderValue for PseudoRetry<'a>

source§

impl<'a> EncoderValue for Retry<'a>

source§

impl<'a, AckRanges: AckRanges, Data: EncoderValue> EncoderValue for Frame<'a, AckRanges, Data>

source§

impl<'a, SupportedVersions: EncoderValue> EncoderValue for VersionNegotiation<'a, SupportedVersions>

source§

impl<A: AckRanges> EncoderValue for Ack<A>

source§

impl<DCID: EncoderValue, Payload: EncoderValue> EncoderValue for Short<DCID, KeyPhase, TruncatedPacketNumber, Payload>

source§

impl<DCID: EncoderValue, SCID: EncoderValue, Payload: EncoderValue> EncoderValue for Handshake<DCID, SCID, TruncatedPacketNumber, Payload>

source§

impl<DCID: EncoderValue, SCID: EncoderValue, Payload: EncoderValue> EncoderValue for ZeroRtt<DCID, SCID, TruncatedPacketNumber, Payload>

source§

impl<DCID: EncoderValue, SCID: EncoderValue, Token: EncoderValue, Payload: EncoderValue> EncoderValue for Initial<DCID, SCID, Token, TruncatedPacketNumber, Payload>

source§

impl<Data: EncoderValue> EncoderValue for Crypto<Data>

source§

impl<Data: EncoderValue> EncoderValue for Datagram<Data>

source§

impl<Data: EncoderValue> EncoderValue for Stream<Data>

source§

impl<OriginalDestinationConnectionId, StatelessResetToken, PreferredAddress, RetrySourceConnectionId> EncoderValue for TransportParameters<OriginalDestinationConnectionId, StatelessResetToken, PreferredAddress, RetrySourceConnectionId>where OriginalDestinationConnectionId: TransportParameter, OriginalDestinationConnectionId::CodecValue: EncoderValue, StatelessResetToken: TransportParameter, StatelessResetToken::CodecValue: EncoderValue, PreferredAddress: TransportParameter, PreferredAddress::CodecValue: EncoderValue, RetrySourceConnectionId: TransportParameter, RetrySourceConnectionId::CodecValue: EncoderValue,