pub trait PacketDecoder<'a> {
type Output;
type Error: From<DecoderError>;
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>;
fn decode_packet<Validator: Validator>(
&mut self,
buffer: DecoderBufferMut<'a>,
connection_info: &ConnectionInfo<'_>,
connection_id_validator: &Validator
) -> Result<(Self::Output, DecoderBufferMut<'a>), Self::Error> { ... }
}