pub struct Connection<T> { /* private fields */ }
Expand description

A Yamux connection object.

Wraps the underlying I/O resource and makes progress via its Connection::next_stream method which must be called repeatedly until Ok(None) signals EOF or an error is encountered.

Implementations

Create a new Connection from the given I/O resource.

Get a controller for this connection.

Get the next incoming stream, opened by the remote.

This must be called repeatedly in order to make progress. Once Ok(None) or Err(_) is returned the connection is considered closed and no further invocation of this method must be attempted.

Cancellation

Please note that if you poll the returned Future it must not be cancelled but polled until Poll::Ready is returned.

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Executes the destructor for this type. 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.

Converts the given value to a String. Read more

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.