Skip to main content

Endpoint

Struct Endpoint 

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

A QUIC endpoint.

Implementations§

Source§

impl Endpoint

Source

pub async fn bind(addr: SocketAddr) -> Result<Self>

Creates a new endpoint bound to a local socket address.

Source

pub async fn server( server_config: ServerConfig, addr: SocketAddr, ) -> Result<Self>

Binds a server endpoint using the supplied TLS and transport settings.

Source

pub fn local_addr(&self) -> Result<SocketAddr>

Returns the address the operating system assigned to this endpoint.

Source

pub async fn server_config(&self) -> Option<ServerConfig>

Returns this endpoint’s server configuration, if configured.

Source

pub async fn set_server_config(&self, config: ServerConfig)

Hot-reloads the server configuration and TLS certificates.

Source

pub async fn stats(&self) -> EndpointStats

Returns snapshot statistics for this endpoint.

Source

pub async fn close(&self, _code: u64, _reason: &[u8])

Gracefully closes the endpoint and all active connections.

Source

pub async fn wait_idle(&self)

Awaits until all active connections on this endpoint have closed.

Source

pub async fn connect( &self, _addr: SocketAddr, _server_name: &str, ) -> Result<Connecting>

Connects to a remote endpoint.

Source

pub async fn connect_with_config( &self, _addr: SocketAddr, _server_name: &str, _config: ClientConfig, ) -> Result<Connecting>

Connects to a remote endpoint using custom client configuration.

Source

pub async fn connect_0rtt( &self, _addr: SocketAddr, _server_name: &str, ) -> Result<Connecting>

Connects to a remote endpoint with 0-RTT early data support (RFC 9001 §4.2).

Source

pub async fn accept(&self) -> Option<Incoming>

Accepts an incoming connection.

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V