Skip to main content

QuicConnection

Struct QuicConnection 

Source
pub struct QuicConnection { /* private fields */ }
Expand description

Single-stream QUIC client. Uses nw_quic_create_options to add QUIC framing on top of secure UDP.

Implementations§

Source§

impl QuicConnection

Source

pub fn establishment_report(&self) -> Option<EstablishmentReport>

Copy the QUIC connection’s establishment report, if the connection is ready.

Source

pub fn data_transfer_report(&self) -> Option<DataTransferReport>

Create a new data-transfer report for this QUIC connection.

Source§

impl QuicConnection

Source

pub fn connect(host: &str, port: u16, alpn: &str) -> Result<Self, NetworkError>

Open a QUIC connection to host:port.

Source

pub fn connect_with_parameters( host: &str, port: u16, parameters: &ConnectionParameters, ) -> Result<Self, NetworkError>

Open a QUIC connection using explicit ConnectionParameters.

Source

pub fn send(&self, data: &[u8]) -> Result<(), NetworkError>

Send data on the single bidirectional stream.

Source

pub fn send_with_context( &self, data: &[u8], context: &ContentContext, ) -> Result<(), NetworkError>

Send data with an explicit ContentContext.

Source

pub fn receive(&self, max_len: usize) -> Result<Vec<u8>, NetworkError>

Receive up to max_len bytes from the stream.

Source

pub fn receive_with_context( &self, max_len: usize, ) -> Result<ReceivedContent, NetworkError>

Receive data together with its ContentContext.

Source§

impl QuicConnection

Source

pub fn metadata(&self) -> Option<QuicMetadata>

Copy the connection-level QUIC metadata snapshot.

Trait Implementations§

Source§

impl Debug for QuicConnection

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for QuicConnection

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Send for QuicConnection

Source§

impl Sync for QuicConnection

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.