ProtocolClient

Trait ProtocolClient 

Source
pub trait ProtocolClient:
    Send
    + Sync
    + 'static {
    type Channel: CommunicationChannel<Error = Self::Error>;
    type Error: CommunicationError;

    // Required method
    fn connect(address: Address, route: &str) -> DynFut<Option<Self::Channel>>;
}
Expand description

The client is only used to create a channel, which should be use to transmit information with the server.

Required Associated Types§

Source

type Channel: CommunicationChannel<Error = Self::Error>

Channel used by this protocol.

Source

type Error: CommunicationError

The error type.

Required Methods§

Source

fn connect(address: Address, route: &str) -> DynFut<Option<Self::Channel>>

Opens a new channel with the current protocol at the given address and route.

  • address - Address to connect to
  • route - The name of the route (no slashes)

Returns None if the connection can’t be done.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§