Connection

Trait Connection 

Source
pub trait Connection:
    Clone
    + Display
    + Debug
    + Send
    + Sync
    + 'static {
    type Notification;
    type Message: Clone + Send + Sync;
    type Encoding: Hash + Clone + Eq + PartialEq + Send + Sync;
    type Error: Into<Error>;

    // Required methods
    fn encoding(&self) -> Self::Encoding;
    fn into_message(
        notification: &Self::Notification,
        encoding: &Self::Encoding,
    ) -> Self::Message;
    fn send<'life0, 'async_trait>(
        &'life0 self,
        message: Self::Message,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn close(&self) -> bool;
    fn is_closed(&self) -> bool;
}

Required Associated Types§

Required Methods§

Source

fn encoding(&self) -> Self::Encoding

Source

fn into_message( notification: &Self::Notification, encoding: &Self::Encoding, ) -> Self::Message

Source

fn send<'life0, 'async_trait>( &'life0 self, message: Self::Message, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn close(&self) -> bool

Source

fn is_closed(&self) -> bool

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§