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
impl QuicConnection
Sourcepub fn establishment_report(&self) -> Option<EstablishmentReport>
pub fn establishment_report(&self) -> Option<EstablishmentReport>
Copy the QUIC connection’s establishment report, if the connection is ready.
Sourcepub fn data_transfer_report(&self) -> Option<DataTransferReport>
pub fn data_transfer_report(&self) -> Option<DataTransferReport>
Create a new data-transfer report for this QUIC connection.
Source§impl QuicConnection
impl QuicConnection
Sourcepub fn connect(host: &str, port: u16, alpn: &str) -> Result<Self, NetworkError>
pub fn connect(host: &str, port: u16, alpn: &str) -> Result<Self, NetworkError>
Open a QUIC connection to host:port.
Sourcepub fn connect_with_parameters(
host: &str,
port: u16,
parameters: &ConnectionParameters,
) -> Result<Self, NetworkError>
pub fn connect_with_parameters( host: &str, port: u16, parameters: &ConnectionParameters, ) -> Result<Self, NetworkError>
Open a QUIC connection using explicit ConnectionParameters.
Sourcepub fn send(&self, data: &[u8]) -> Result<(), NetworkError>
pub fn send(&self, data: &[u8]) -> Result<(), NetworkError>
Send data on the single bidirectional stream.
Sourcepub fn send_with_context(
&self,
data: &[u8],
context: &ContentContext,
) -> Result<(), NetworkError>
pub fn send_with_context( &self, data: &[u8], context: &ContentContext, ) -> Result<(), NetworkError>
Send data with an explicit ContentContext.
Sourcepub fn receive(&self, max_len: usize) -> Result<Vec<u8>, NetworkError>
pub fn receive(&self, max_len: usize) -> Result<Vec<u8>, NetworkError>
Receive up to max_len bytes from the stream.
Sourcepub fn receive_with_context(
&self,
max_len: usize,
) -> Result<ReceivedContent, NetworkError>
pub fn receive_with_context( &self, max_len: usize, ) -> Result<ReceivedContent, NetworkError>
Receive data together with its ContentContext.
Source§impl QuicConnection
impl QuicConnection
Sourcepub fn metadata(&self) -> Option<QuicMetadata>
pub fn metadata(&self) -> Option<QuicMetadata>
Copy the connection-level QUIC metadata snapshot.
Trait Implementations§
Source§impl Debug for QuicConnection
impl Debug for QuicConnection
Source§impl Drop for QuicConnection
impl Drop for QuicConnection
impl Send for QuicConnection
impl Sync for QuicConnection
Auto Trait Implementations§
impl !RefUnwindSafe for QuicConnection
impl !UnwindSafe for QuicConnection
impl Freeze for QuicConnection
impl Unpin for QuicConnection
impl UnsafeUnpin for QuicConnection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more