[−][src]Struct quinn_proto::generic::Endpoint
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]
S: Session,
pub fn new(
log: Logger,
config: Arc<EndpointConfig>,
server_config: Option<Arc<ServerConfig<S>>>
) -> Result<Self, ConfigError>
[src]
log: Logger,
config: Arc<EndpointConfig>,
server_config: Option<Arc<ServerConfig<S>>>
) -> Result<Self, ConfigError>
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]
&mut self,
ch: ConnectionHandle,
event: EndpointEvent
) -> Option<ConnectionEvent>
Process EndpointEvent
s emitted from related Connection
s
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]
&mut self,
now: Instant,
remote: SocketAddr,
ecn: Option<EcnCodepoint>,
data: BytesMut
) -> Option<(ConnectionHandle, DatagramEvent<S>)>
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]
&mut self,
config: ClientConfig<S::ClientConfig>,
remote: SocketAddr,
server_name: &str
) -> Result<(ConnectionHandle, Connection<S>), ConnectError>
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,
<S as Session>::HmacKey: Unpin,
impl<S> Sync for Endpoint<S> where
<S as Session>::HmacKey: Sync,
<S as Session>::ServerConfig: Send + Sync,
<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,
<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,
<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,
<S as Session>::HmacKey: RefUnwindSafe,
<S as Session>::ServerConfig: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> SendSyncUnwindSafe for T where
T: Send + Sync + UnwindSafe + ?Sized,
[src]
T: Send + Sync + UnwindSafe + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,