Skip to main content

QuinnConn

Trait QuinnConn 

Source
pub trait QuinnConn:
    Clone
    + Send
    + Sync {
    type AddrType: Debug;
    type SockAddrType: Debug;

Show 14 methods // Required methods fn open_bi(&self) -> OpenBi<'_>; fn accept_bi(&self) -> AcceptBi<'_>; fn read_datagram(&self) -> ReadDatagram<'_>; fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>; fn send_datagram_wait(&self, data: Bytes) -> SendDatagram<'_>; fn closed(&self) -> impl Future<Output = ConnectionError> + Send; fn close_reason(&self) -> Option<ConnectionError>; fn close(&self, error_code: VarInt, reason: &[u8]); fn max_datagram_size(&self) -> Option<usize>; fn datagram_send_buffer_space(&self) -> usize; fn remote_address(&self) -> Self::SockAddrType; fn local_ip(&self) -> Option<Self::AddrType>; fn stable_id(&self) -> usize; fn stats(&self) -> ConnectionStats;
}
Expand description

Abstract over different types of Quinn-connections that differ only in the type of address that is used for the local and remote address.

Required Associated Types§

Source

type AddrType: Debug

The type used to represent the local address.

Source

type SockAddrType: Debug

The type used to represent the remote socket address.

Required Methods§

Source

fn open_bi(&self) -> OpenBi<'_>

Opens a new bidirectional stream.

Source

fn accept_bi(&self) -> AcceptBi<'_>

Accepts a new incoming bidirectional stream.

Source

fn read_datagram(&self) -> ReadDatagram<'_>

Reads a datagram, if one is available.

Source

fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>

Sends a datagram.

Source

fn send_datagram_wait(&self, data: Bytes) -> SendDatagram<'_>

Sends a datagram and wait for it to be sent.

Source

fn closed(&self) -> impl Future<Output = ConnectionError> + Send

Waits for the connection to be closed.

Source

fn close_reason(&self) -> Option<ConnectionError>

Returns the reason why the connection was closed, if it was closed.

Source

fn close(&self, error_code: VarInt, reason: &[u8])

Closes the connection with the given error code and reason.

Source

fn max_datagram_size(&self) -> Option<usize>

Returns the maximum datagram size that can be sent on this connection.

Source

fn datagram_send_buffer_space(&self) -> usize

Returns the amount of buffer space available for sending datagrams.

Source

fn remote_address(&self) -> Self::SockAddrType

Returns the remote socket address type.

Source

fn local_ip(&self) -> Option<Self::AddrType>

Returns the local address type.

Source

fn stable_id(&self) -> usize

Returns a stable connection identifier.

Source

fn stats(&self) -> ConnectionStats

Returns connection statistics.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl QuinnConn for Connection

Implementors§