pub struct Connection { /* private fields */ }
Expand description

A QUIC connection

Implementations

Accepts an incoming Stream

The method will return

  • Poll::Ready(Ok(Some(stream, stream_type))) if a Stream was accepted
  • Poll::Ready(Ok(None)) if the connection was closed without an error
  • Poll::Ready(Err(stream_error)) if no stream could be accepted due to an error
  • Poll::Pending if no new Stream of the given type was accepted by the connection yet. In this case the caller must retry calling Self::poll_accept. For this purpose the method will save the core::task::Waker which is provided as part of the Context parameter, and notify it as soon as retrying the method will yield a different result.

Closes the Connection with the provided error code

This will immediately terminate all outstanding streams.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. 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.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. 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.