Skip to main content

SendErrorCallback

Trait SendErrorCallback 

Source
pub trait SendErrorCallback<Message, Error>: Send + 'static {
    // Required method
    fn on_send_error(
        &mut self,
        message: &Message,
        error: Error<Error>,
    ) -> ErrorHandlingStrategy;
}
Expand description

Callback called when an error is encountered while trying to send a message through the transport.

NOTE: it also receives dnet_base::Error::Closed errors and they need to be handled properly (most likely by returning ErrorHandlingStrategy::Close).

Required Methods§

Source

fn on_send_error( &mut self, message: &Message, error: Error<Error>, ) -> ErrorHandlingStrategy

Handle sending error.

NOTE: it also receives dnet_base::Error::Closed errors and they need to be handled properly (most likely by returning ErrorHandlingStrategy::Close).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<Message, Error> SendErrorCallback<Message, Error> for DefaultSendErrorCallback

Source§

impl<T, Message, Error> SendErrorCallback<Message, Error> for T
where T: FnMut(&Message, Error<Error>) -> ErrorHandlingStrategy + Send + 'static,

Available on non-WebAssembly only.