Trait phron_finality::network::gossip::RawNetwork
source · 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§
type SenderError: Error
type NetworkSender: NetworkSender
type PeerId: Clone + Debug + Eq + Hash + Send + 'static
type EventStream: EventStream<Self::PeerId>
Required Methods§
sourcefn event_stream(&self) -> Self::EventStream
fn event_stream(&self) -> Self::EventStream
Returns a stream of events representing what happens on the network.
sourcefn sender(
&self,
peer_id: Self::PeerId,
protocol: Protocol
) -> Result<Self::NetworkSender, Self::SenderError>
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.