pub trait ConnectionHandler: Send + 'static {
// Required method
fn message_received(&mut self, message: PublishedMessage);
// Provided methods
fn connected(&mut self) { ... }
fn disconnected(&mut self, _frame: Option<CloseFrame<'static>>) { ... }
fn inbound_error(&mut self, _error: ClientError) { ... }
fn outbound_error(&mut self, _error: ClientError) { ... }
}Expand description
Handlers for the RPC stream events.
Required Methods§
Sourcefn message_received(&mut self, message: PublishedMessage)
fn message_received(&mut self, message: PublishedMessage)
Called when a message is received from the Relay.
Provided Methods§
Sourcefn disconnected(&mut self, _frame: Option<CloseFrame<'static>>)
fn disconnected(&mut self, _frame: Option<CloseFrame<'static>>)
Called when the Relay connection is closed.
Sourcefn inbound_error(&mut self, _error: ClientError)
fn inbound_error(&mut self, _error: ClientError)
Called when an inbound error occurs, such as data deserialization failure, or an unknown response message ID.
Sourcefn outbound_error(&mut self, _error: ClientError)
fn outbound_error(&mut self, _error: ClientError)
Called when an outbound error occurs, i.e. failed to write to the websocket stream.