pub trait RawNetwork: Clone + Send + Sync + 'static {
    type SenderError: Error;
    type NetworkSender: NetworkSender;
    type PeerId: Clone + Debug + Eq + Hash + Send + 'static;
    type EventStream: EventStream<Self::PeerId>;

    // Required methods
    fn event_stream(&self) -> Self::EventStream;
    fn sender(
        &self,
        peer_id: Self::PeerId,
        protocol: Protocol
    ) -> Result<Self::NetworkSender, Self::SenderError>;
}
Expand description

Abstraction over a raw p2p network.

Required Associated Types§

Required Methods§

source

fn event_stream(&self) -> Self::EventStream

Returns a stream of events representing what happens on the network.

source

fn sender( &self, peer_id: Self::PeerId, protocol: Protocol ) -> Result<Self::NetworkSender, Self::SenderError>

Returns a sender to the given peer using a given protocol. Returns Error if not connected to the peer.

Object Safety§

This trait is not object safe.

Implementors§