chronicle::network

Trait Network

Source
pub trait Network:
    Send
    + Sync
    + 'static {
    // Required methods
    fn peer_id(&self) -> PeerId;
    fn format_peer_id(&self, peer_id: PeerId) -> String;
    fn send(
        &self,
        peer_id: PeerId,
        msg: Message,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send>>;
}

Required Methods§

Source

fn peer_id(&self) -> PeerId

Source

fn format_peer_id(&self, peer_id: PeerId) -> String

Source

fn send( &self, peer_id: PeerId, msg: Message, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send>>

Implementations on Foreign Types§

Source§

impl Network for Arc<dyn Network>

Source§

fn peer_id(&self) -> PeerId

Source§

fn format_peer_id(&self, peer: PeerId) -> String

Source§

fn send( &self, peer_id: PeerId, msg: Message, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send>>

Implementors§