Endpoint

Trait Endpoint 

Source
pub trait Endpoint: Send + Sync {
    // Required methods
    fn id(&self) -> &str;
    fn send(
        &self,
        exchange: Exchange,
    ) -> impl Future<Output = Result<(), Error>> + Send;
    fn try_receive(&self) -> impl Future<Output = Option<Exchange>> + Send;
}
Expand description

A trait representing a message endpoint for sending and receiving Exchange objects.

Required Methods§

Source

fn id(&self) -> &str

Stable identifier for this endpoint instance.

Source

fn send( &self, exchange: Exchange, ) -> impl Future<Output = Result<(), Error>> + Send

Enqueue of an Exchange.

Source

fn try_receive(&self) -> impl Future<Output = Option<Exchange>> + Send

Non-blocking dequeue of next Exchange.

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§