[][src]Struct quinn_proto::generic::Endpoint

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

The main entry point to the library

This object performs no I/O whatsoever. Instead, it generates a stream of packets to send via poll_transmit, and consumes incoming packets and connection-generated events via handle and handle_event.

Methods

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

pub fn new(
    log: Logger,
    config: Arc<EndpointConfig>,
    server_config: Option<Arc<ServerConfig<S>>>
) -> Result<Self, ConfigError>
[src]

Create a new endpoint

Returns Err if the configuration is invalid.

pub fn poll_transmit(&mut self) -> Option<Transmit>[src]

Get the next packet to transmit

pub fn handle_event(
    &mut self,
    ch: ConnectionHandle,
    event: EndpointEvent
) -> Option<ConnectionEvent>
[src]

Process EndpointEvents emitted from related Connections

In turn, processing this event may return a ConnectionEvent for the same Connection.

pub fn handle(
    &mut self,
    now: Instant,
    remote: SocketAddr,
    ecn: Option<EcnCodepoint>,
    data: BytesMut
) -> Option<(ConnectionHandle, DatagramEvent<S>)>
[src]

Process an incoming UDP datagram

pub fn connect(
    &mut self,
    config: ClientConfig<S::ClientConfig>,
    remote: SocketAddr,
    server_name: &str
) -> Result<(ConnectionHandle, Connection<S>), ConnectError>
[src]

Initiate a connection

pub fn accept(&mut self)[src]

Free a handshake slot for reuse

Every time an [Event::Handshaking] is emitted, a slot is consumed, up to a limit of [ServerConfig.accept_buffer]. Calling this indicates the application's acceptance of that connection and releases the slot for reuse.

pub fn reject_new_connections(&mut self)[src]

Unconditionally reject future incoming connections

Auto Trait Implementations

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

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

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

impl<S> UnwindSafe for Endpoint<S> where
    <S as Session>::HmacKey: UnwindSafe,
    <S as Session>::ServerConfig: RefUnwindSafe

impl<S> RefUnwindSafe for Endpoint<S> where
    <S as Session>::HmacKey: RefUnwindSafe,
    <S as Session>::ServerConfig: RefUnwindSafe

Blanket Implementations

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

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

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<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]

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