pub struct Connection<TMuxer, THandler> where
    TMuxer: StreamMuxer,
    THandler: ConnectionHandler<Substream = Substream<TMuxer>>, 
{ /* private fields */ }
Expand description

A multiplexed connection to a peer with an associated ConnectionHandler.

Implementations

Builds a new Connection from the given substream multiplexer and connection handler.

Returns a reference to the ConnectionHandler

Returns a mutable reference to the ConnectionHandler

Notifies the connection handler of an event.

Begins an orderly shutdown of the connection, returning a Future that resolves when connection shutdown is complete.

Polls the connection for events produced by the associated handler as a result of I/O activity on the substream multiplexer.

Trait Implementations

Formats the value using the given formatter. Read more

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.