Trait vapcore_light::net::BasicContext[][src]

pub trait BasicContext {
    fn persistent_peer_id(&self, peer: PeerId) -> Option<NodeId>;
fn request_from(
        &self,
        peer: PeerId,
        request: Requests
    ) -> Result<ReqId, Error>;
fn make_announcement(&self, announcement: Announcement);
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>[src]

Returns the relevant’s peer persistent Id (aka NodeId).

fn request_from(&self, peer: PeerId, request: Requests) -> Result<ReqId, Error>[src]

Make a request from a peer.

Fails on: nonexistent peer, network error, peer not server, insufficient credits. Does not check capabilities before sending. On success, returns a request id which can later be coordinated with an event.

fn make_announcement(&self, announcement: Announcement)[src]

Make an announcement of new capabilities to the rest of the peers.

fn disconnect_peer(&self, peer: PeerId)[src]

Disconnect a peer.

fn disable_peer(&self, peer: PeerId)[src]

Disable a peer.

Loading content...

Implementors

Loading content...