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