commonware_runtime

Trait Network

source
pub trait Network<L, Si, St>:
    Clone
    + Send
    + Sync
    + 'static
where L: Listener<Si, St>, Si: Sink, St: Stream,
{ // Required methods fn bind( &self, socket: SocketAddr, ) -> impl Future<Output = Result<L, Error>> + Send; fn dial( &self, socket: SocketAddr, ) -> impl Future<Output = Result<(Si, St), Error>> + Send; }
Expand description

Interface that any runtime must implement to create network connections.

Required Methods§

source

fn bind( &self, socket: SocketAddr, ) -> impl Future<Output = Result<L, Error>> + Send

Bind to the given socket address.

source

fn dial( &self, socket: SocketAddr, ) -> impl Future<Output = Result<(Si, St), Error>> + Send

Dial the given socket address.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Network<Listener, Sink, Stream> for commonware_runtime::deterministic::Context

source§

impl Network<Listener, Sink, Stream> for commonware_runtime::tokio::Context