Struct quicr::Connection [−][src]
pub struct Connection(_);
A QUIC connection.
If a Connection
is dropped without being explicitly closed, it will be automatically closed with an error_code
of 0 and an empty reason
.
Methods
impl Connection
[src]
impl Connection
pub fn open_uni(
&self
) -> impl Future<Item = SendStream, Error = ConnectionError>
[src]
pub fn open_uni(
&self
) -> impl Future<Item = SendStream, Error = ConnectionError>
Initite a new outgoing unidirectional stream.
pub fn open_bi(
&self
) -> impl Future<Item = Stream, Error = ConnectionError>
[src]
pub fn open_bi(
&self
) -> impl Future<Item = Stream, Error = ConnectionError>
Initiate a new outgoing bidirectional stream.
pub fn close(
self,
error_code: u16,
reason: &[u8]
) -> impl Future<Item = (), Error = ()>
[src]
pub fn close(
self,
error_code: u16,
reason: &[u8]
) -> impl Future<Item = (), Error = ()>
Close the connection immediately.
This does not ensure delivery of outstanding data. It is the application's responsibility to call this only when all important communications have been completed.
error_code
and reason
are not interpreted, and are provided directly to the peer.
reason
will be truncated to fit in a single packet with overhead; to be certain it is preserved in full, it
should be kept under 1KiB.
pub fn remote_address(&self) -> SocketAddr
[src]
pub fn remote_address(&self) -> SocketAddr
The peer's UDP address.
pub fn local_id(&self) -> ConnectionId
[src]
pub fn local_id(&self) -> ConnectionId
The ConnectionId
used for conn
locally.
pub fn remote_id(&self) -> ConnectionId
[src]
pub fn remote_id(&self) -> ConnectionId
The ConnectionId
used for conn
by the peer.
pub fn protocol(&self) -> Option<Box<[u8]>>
[src]
pub fn protocol(&self) -> Option<Box<[u8]>>
The negotiated application protocol
pub fn session_resumed(&self) -> bool
[src]
pub fn session_resumed(&self) -> bool
Whether the cryptographic session was resumed
Auto Trait Implementations
impl !Send for Connection
impl !Send for Connection
impl !Sync for Connection
impl !Sync for Connection