Crate pea2pea[][src]

Expand description

pea2pea is a P2P library designed with the following use cases in mind:

  • simple and quick creation of custom P2P networks
  • testing/verifying network protocols
  • benchmarking and stress-testing P2P nodes (or other network entities)
  • substituting other, “heavier” nodes in local network tests

Re-exports

pub use connections::Connection;
pub use connections::ConnectionSide;

Modules

connections

Objects associated with connection handling.

protocols

Opt-in protocols available to the Node; each protocol is expected to spawn its own task that runs throughout the Node’s lifetime and handles a specific functionality. The communication with these tasks is done via ProtocolHandlers.

Structs

KnownPeers

Contains statistics related to node’s peers, currently connected or not.

Node

The central object responsible for handling all the connections.

NodeConfig

The node’s configuration.

NodeStats

Contains statistics related to the node.

PeerStats

Contains statistics related to a single peer.

Enums

Topology

The way in which nodes are connected to each other; used in connect_nodes.

Traits

Pea2Pea

A trait for objects containing a Node; it is required to implement protocols.

Functions

connect_nodes

Connects the provided list of nodes in order to form the given Topology.