[][src]Struct quinn::Endpoint

pub struct Endpoint { /* 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 Endpoint[src]

pub fn builder() -> EndpointBuilder[src]

Begin constructing an Endpoint

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

Connect to a remote endpoint. Be sure to spawn the ConnectionDriver after connecting.

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,
    addr: &SocketAddr,
    server_name: &str
) -> Result<Connecting, 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.

Trait Implementations

impl Clone for Endpoint[src]

impl Debug for Endpoint[src]

Auto Trait Implementations

impl !RefUnwindSafe for Endpoint

impl Send for Endpoint

impl Sync for Endpoint

impl Unpin for Endpoint

impl !UnwindSafe for Endpoint

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>,