pub struct NetworkContext<'s> { /* private fields */ }
Expand description

IO access point. This is passed to all IO handlers and provides an interface to the IO subsystem.

Trait Implementations

Send a packet over the network to another peer.

Send a packet over the network to another peer using specified protocol.

Respond to a current network message. Panics if no there is no packet in the context. If the session is expired returns nothing.

Disconnect a peer and prevent it from connecting again.

Disconnect peer. Reconnect can be attempted later.

Check if the session is still active.

Register a new IO timer. ‘IoHandler::timeout’ will be called with the token.

Returns peer identification string

Returns information on p2p session

Returns max version for a given protocol.

Returns this object’s subprotocol name.

Returns whether the given peer ID is a reserved peer.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.