pub trait IFerroRemoteTransportConnection: Send + Sync {
// Required methods
fn dispose(&self);
fn send(&self, data: Message) -> Task;
fn on_message(&self, handler: MessageHandler) -> HandlerToken;
fn remove_on_message(&self, token: HandlerToken);
fn on_exception(&self, handler: ExceptionHandler) -> HandlerToken;
fn remove_on_exception(&self, token: HandlerToken);
fn start(&self);
}Expand description
A connection to the other end of the protocol.
Required Methods§
Sourcefn dispose(&self)
fn dispose(&self)
IDisposable.Dispose: closes the connection. No exception event
follows from the closing itself.
Sourcefn send(&self, data: Message) -> Task
fn send(&self, data: Message) -> Task
Sends a message. The task completes when the message was written (or dropped because the connection is broken) and fails when the message cannot be sent as it is: its class is not known to the resolver, or it cannot be serialized.
Sourcefn on_message(&self, handler: MessageHandler) -> HandlerToken
fn on_message(&self, handler: MessageHandler) -> HandlerToken
OnMessage += handler.
Sourcefn remove_on_message(&self, token: HandlerToken)
fn remove_on_message(&self, token: HandlerToken)
OnMessage -= handler.
Sourcefn on_exception(&self, handler: ExceptionHandler) -> HandlerToken
fn on_exception(&self, handler: ExceptionHandler) -> HandlerToken
OnException += handler.
Sourcefn remove_on_exception(&self, token: HandlerToken)
fn remove_on_exception(&self, token: HandlerToken)
OnException -= handler.
fn start(&self)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".