Skip to main content

IFerroRemoteTransportConnection

Trait IFerroRemoteTransportConnection 

Source
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§

Source

fn dispose(&self)

IDisposable.Dispose: closes the connection. No exception event follows from the closing itself.

Source

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.

Source

fn on_message(&self, handler: MessageHandler) -> HandlerToken

OnMessage += handler.

Source

fn remove_on_message(&self, token: HandlerToken)

OnMessage -= handler.

Source

fn on_exception(&self, handler: ExceptionHandler) -> HandlerToken

OnException += handler.

Source

fn remove_on_exception(&self, token: HandlerToken)

OnException -= handler.

Source

fn start(&self)

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§