Trait ethcore_light::net::BasicContext
[−]
[src]
pub trait BasicContext { fn persistent_peer_id(&self, peer: PeerId) -> Option<NodeId>; fn request_from(&self, peer: PeerId, request: Request) -> Result<ReqId, Error>; fn make_announcement(&self, announcement: Announcement); fn max_requests(&self, peer: PeerId, kind: Kind) -> usize; fn disconnect_peer(&self, peer: PeerId); fn disable_peer(&self, peer: PeerId); }
Basic context for the protocol.
Required Methods
fn persistent_peer_id(&self, peer: PeerId) -> Option<NodeId>
Returns the relevant's peer persistent Id (aka NodeId).
fn request_from(&self, peer: PeerId, request: Request) -> Result<ReqId, Error>
Make a request from a peer.
fn make_announcement(&self, announcement: Announcement)
Make an announcement of new capabilities to the rest of the peers.
fn max_requests(&self, peer: PeerId, kind: Kind) -> usize
Find the maximum number of requests of a specific type which can be made from supplied peer.
fn disconnect_peer(&self, peer: PeerId)
Disconnect a peer.
fn disable_peer(&self, peer: PeerId)
Disable a peer.