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§

source

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

source

fn on_connection_error(&mut self, error: Error)

A callback used to notify the application in the case of a connection error

Implementors§