pub struct Endpoint { /* private fields */ }Expand description
A QUIC endpoint.
Implementations§
Source§impl Endpoint
impl Endpoint
Sourcepub async fn bind(addr: SocketAddr) -> Result<Self>
pub async fn bind(addr: SocketAddr) -> Result<Self>
Creates a new endpoint bound to a local socket address.
Sourcepub async fn server(
server_config: ServerConfig,
addr: SocketAddr,
) -> Result<Self>
pub async fn server( server_config: ServerConfig, addr: SocketAddr, ) -> Result<Self>
Binds a server endpoint using the supplied TLS and transport settings.
Sourcepub fn local_addr(&self) -> Result<SocketAddr>
pub fn local_addr(&self) -> Result<SocketAddr>
Returns the address the operating system assigned to this endpoint.
Sourcepub async fn server_config(&self) -> Option<ServerConfig>
pub async fn server_config(&self) -> Option<ServerConfig>
Returns this endpoint’s server configuration, if configured.
Sourcepub async fn set_server_config(&self, config: ServerConfig)
pub async fn set_server_config(&self, config: ServerConfig)
Hot-reloads the server configuration and TLS certificates.
Sourcepub async fn stats(&self) -> EndpointStats
pub async fn stats(&self) -> EndpointStats
Returns snapshot statistics for this endpoint.
Sourcepub async fn close(&self, _code: u64, _reason: &[u8])
pub async fn close(&self, _code: u64, _reason: &[u8])
Gracefully closes the endpoint and all active connections.
Sourcepub async fn wait_idle(&self)
pub async fn wait_idle(&self)
Awaits until all active connections on this endpoint have closed.
Sourcepub async fn connect(
&self,
_addr: SocketAddr,
_server_name: &str,
) -> Result<Connecting>
pub async fn connect( &self, _addr: SocketAddr, _server_name: &str, ) -> Result<Connecting>
Connects to a remote endpoint.
Sourcepub async fn connect_with_config(
&self,
_addr: SocketAddr,
_server_name: &str,
_config: ClientConfig,
) -> Result<Connecting>
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.
Sourcepub async fn connect_0rtt(
&self,
_addr: SocketAddr,
_server_name: &str,
) -> Result<Connecting>
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).
Auto Trait Implementations§
impl !RefUnwindSafe for Endpoint
impl !UnwindSafe for Endpoint
impl Freeze for Endpoint
impl Send for Endpoint
impl Sync for Endpoint
impl Unpin for Endpoint
impl UnsafeUnpin for Endpoint
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