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

A QUIC endpoint.

An endpoint corresponds to a single UDP socket, may host many connections, and may act as both client and server for different connections.

May be cloned to obtain another handle to the same endpoint.

Implementations

Construct an endpoint with arbitrary configuration

Must be called from within a tokio runtime context.

Set the client configuration used by connect

Connect to a remote endpoint

server_name must be covered by the certificate presented by the server. This prevents a connection from being intercepted by an attacker with a valid certificate for some other server.

May fail immediately due to configuration errors, or in the future if the connection could not be established.

Connect to a remote endpoint using a custom configuration.

See connect() for details.

Switch to a new UDP socket

Allows the endpoint’s address to be updated live, affecting all active connections. Incoming connections and connections to servers unreachable from the new address will be lost.

On error, the old UDP socket is retained.

Replace the server configuration, affecting new incoming connections only

Useful for e.g. refreshing TLS certificates without disrupting existing connections.

Get the local SocketAddr the underlying socket is bound to

Close all of this endpoint’s connections immediately and cease accepting new connections.

See Connection::close() for details.

Wait for all connections on the endpoint to be cleanly shut down

Waiting for this condition before exiting ensures that a good-faith effort is made to notify peers of recent connection closes, whereas exiting immediately could force them to wait out the idle timeout period.

Does not proactively close existing connections or cause incoming connections to be rejected. Consider calling close() and dropping the Incoming stream if that is desired.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more