Trait PacketDecoder

Source
pub trait PacketDecoder<'a> {
    type Output;
    type Error: From<DecoderError>;

    // Required methods
    fn handle_short_packet(
        &mut self,
        packet: ProtectedShort<'a>,
    ) -> Result<Self::Output, Self::Error>;
    fn handle_version_negotiation_packet(
        &mut self,
        packet: ProtectedVersionNegotiation<'a>,
    ) -> Result<Self::Output, Self::Error>;
    fn handle_initial_packet(
        &mut self,
        packet: ProtectedInitial<'a>,
    ) -> Result<Self::Output, Self::Error>;
    fn handle_zero_rtt_packet(
        &mut self,
        packet: ProtectedZeroRtt<'a>,
    ) -> Result<Self::Output, Self::Error>;
    fn handle_handshake_packet(
        &mut self,
        packet: ProtectedHandshake<'a>,
    ) -> Result<Self::Output, Self::Error>;
    fn handle_retry_packet(
        &mut self,
        packet: ProtectedRetry<'a>,
    ) -> Result<Self::Output, Self::Error>;

    // Provided method
    fn decode_packet<Validator: Validator>(
        &mut self,
        buffer: DecoderBufferMut<'a>,
        connection_info: &ConnectionInfo<'_>,
        connection_id_validator: &Validator,
    ) -> Result<(Self::Output, DecoderBufferMut<'a>), Self::Error> { ... }
}

Required Associated Types§

Required Methods§

Source

fn handle_short_packet( &mut self, packet: ProtectedShort<'a>, ) -> Result<Self::Output, Self::Error>

Source

fn handle_version_negotiation_packet( &mut self, packet: ProtectedVersionNegotiation<'a>, ) -> Result<Self::Output, Self::Error>

Source

fn handle_initial_packet( &mut self, packet: ProtectedInitial<'a>, ) -> Result<Self::Output, Self::Error>

Source

fn handle_zero_rtt_packet( &mut self, packet: ProtectedZeroRtt<'a>, ) -> Result<Self::Output, Self::Error>

Source

fn handle_handshake_packet( &mut self, packet: ProtectedHandshake<'a>, ) -> Result<Self::Output, Self::Error>

Source

fn handle_retry_packet( &mut self, packet: ProtectedRetry<'a>, ) -> Result<Self::Output, Self::Error>

Provided Methods§

Source

fn decode_packet<Validator: Validator>( &mut self, buffer: DecoderBufferMut<'a>, connection_info: &ConnectionInfo<'_>, connection_id_validator: &Validator, ) -> Result<(Self::Output, DecoderBufferMut<'a>), Self::Error>

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.

Implementors§