[][src]Struct quinn::generic::Endpoint

pub struct Endpoint<S> where
    S: Session
{ /* fields omitted */ }

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.

Methods

impl<S> Endpoint<S> where
    S: Session + 'static, 
[src]

pub fn builder() -> EndpointBuilder<S>[src]

Begin constructing an Endpoint

pub fn connect(
    &self,
    addr: &SocketAddr,
    server_name: &str
) -> Result<Connecting<S>, ConnectError>
[src]

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.

pub fn connect_with(
    &self,
    config: ClientConfig<S>,
    addr: &SocketAddr,
    server_name: &str
) -> Result<Connecting<S>, ConnectError>
[src]

Connect to a remote endpoint using a custom configuration.

See connect for details.

pub fn rebind(&self, socket: UdpSocket) -> Result<()>[src]

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.

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

Get the local SocketAddr the underlying socket is bound to

pub fn close(&self, error_code: VarInt, reason: &[u8])[src]

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

See Connection::close for details.

pub async fn wait_idle<'_>(&'_ self)[src]

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 Endpoint::close and dropping the Incoming stream if that is desired.

Trait Implementations

impl<S> Clone for Endpoint<S> where
    S: Session
[src]

impl<S: Debug> Debug for Endpoint<S> where
    S: Session
[src]

Auto Trait Implementations

impl<S> RefUnwindSafe for Endpoint<S> where
    <S as Session>::ClientConfig: RefUnwindSafe

impl<S> Send for Endpoint<S> where
    <S as Session>::ClientConfig: Send,
    <<S as Session>::Keys as Keys>::HeaderKeys: Send,
    <S as Session>::HmacKey: Send + Sync,
    <S as Session>::Keys: Send,
    <S as Session>::ServerConfig: Send + Sync

impl<S> Sync for Endpoint<S> where
    <S as Session>::ClientConfig: Sync,
    <<S as Session>::Keys as Keys>::HeaderKeys: Send,
    <S as Session>::HmacKey: Send + Sync,
    <S as Session>::Keys: Send,
    <S as Session>::ServerConfig: Send + Sync

impl<S> Unpin for Endpoint<S> where
    <S as Session>::ClientConfig: Unpin

impl<S> UnwindSafe for Endpoint<S> where
    <S as Session>::ClientConfig: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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