Struct quinn::NewConnection
source · [−]#[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
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
Auto Trait Implementations
impl RefUnwindSafe for NewConnection
impl Send for NewConnection
impl Sync for NewConnection
impl Unpin for NewConnection
impl UnwindSafe for NewConnection
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more