Trait s2n_quic_core::datagram::traits::Receiver
source · pub trait Receiver: 'static + Send {
// Required methods
fn on_datagram(&mut self, context: &ReceiveContext<'_>, datagram: &[u8]);
fn on_connection_error(&mut self, error: Error);
}
Expand description
Allows users to configure the behavior of receiving datagrams.
Required Methods§
sourcefn on_datagram(&mut self, context: &ReceiveContext<'_>, datagram: &[u8])
fn on_datagram(&mut self, context: &ReceiveContext<'_>, datagram: &[u8])
A callback that gives users direct access to datagrams as they are read off a packet
sourcefn on_connection_error(&mut self, error: Error)
fn on_connection_error(&mut self, error: Error)
A callback used to notify the application in the case of a connection error