#[non_exhaustive]
pub struct NewConnection { pub connection: Connection, pub uni_streams: IncomingUniStreams, pub bi_streams: IncomingBiStreams, pub datagrams: Datagrams, }
Expand description

Components of a newly established connection

All fields of this struct, in addition to any other handles constructed later, must be dropped for a connection to be implicitly closed. If the NewConnection is stored in a long-lived variable, moving individual fields won’t cause remaining unused fields to be dropped, even with pattern-matching. The easiest way to ensure unused fields are dropped is to pattern-match on the variable wrapped in brackets, which forces the entire NewConnection to be moved out of the variable and into a temporary, ensuring all unused fields are dropped at the end of the statement:

let NewConnection { connection, .. } = { new_connection };

You can also explicitly invoke Connection::close() at any time.

Fields (Non-exhaustive)

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
connection: Connection

Handle for interacting with the connection

uni_streams: IncomingUniStreams

Unidirectional streams initiated by the peer, in the order they were opened

Note that data for separate streams may be delivered in any order. In other words, reading from streams in the order they’re opened is not optimal. See IncomingUniStreams for details.

bi_streams: IncomingBiStreams

Bidirectional streams initiated by the peer, in the order they were opened

datagrams: Datagrams

Unordered, unreliable datagrams sent by the peer

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.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more