pub trait Sender: 'static + Send {
    // Required methods
    fn on_transmit<P: Packet>(&mut self, packet: &mut P);
    fn has_transmission_interest(&self) -> bool;
    fn on_connection_error(&mut self, error: Error);
}
Expand description

Allows users to configure the behavior of sending datagrams.

Required Methods§

source

fn on_transmit<P: Packet>(&mut self, packet: &mut P)

A callback that allows users to write datagrams directly to the packet

source

fn has_transmission_interest(&self) -> bool

A callback that checks if a user has datagrams ready to send

Use method to trigger the on_transmit callback

source

fn on_connection_error(&mut self, error: Error)

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

Object Safety§

This trait is not object safe.

Implementors§