# 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.

## Implementors

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result
+
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)