Struct pea2pea::Node [−][src]
pub struct Node(_);
Expand description
The central object responsible for handling all the connections.
Implementations
Creates a new Node
optionally using a given NodeConfig
.
Returns a reference to the node’s config.
Returns the node’s listening address.
Connects to the provided SocketAddr
.
Disconnects from the provided SocketAddr
.
Sends the provided message to the specified SocketAddr
, as long as the Writing
protocol is enabled.
Broadcasts the provided message to all peers, as long as the Writing
protocol is enabled.
Returns a list containing addresses of active connections.
Returns a reference to the collection of statistics of node’s known peers.
Checks whether the provided address is connected.
Returns the number of active connections.
Returns the number of connections that are currently being set up.
Sets up the handshake handler, as part of the Handshaking
protocol.
Sets up the reading handler, as part of enabling the Reading
protocol.
Sets up the writing handler, as part of enabling the Writing
protocol.
Methods from Deref<Target = Arc<InnerNode>>
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Node
impl !UnwindSafe for Node
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more