pub trait Transport<N: Network>: Send + Sync {
// Required methods
fn send<'life0, 'async_trait>(
&'life0 self,
peer_ip: SocketAddr,
event: Event<N>,
) -> Pin<Box<dyn Future<Output = Option<Receiver<Result<()>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn broadcast(&self, event: Event<N>);
}Expand description
Part of the Gateway API that deals with networking. This is a separate trait to allow for easier testing/mocking.
Required Methods§
fn send<'life0, 'async_trait>(
&'life0 self,
peer_ip: SocketAddr,
event: Event<N>,
) -> Pin<Box<dyn Future<Output = Option<Receiver<Result<()>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn broadcast(&self, event: Event<N>)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".