Struct quinn::generic::Endpoint [−][src]
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
impl<S> Endpoint<S> where
S: Session + 'static,
[src]
S: Session + 'static,
pub fn builder() -> EndpointBuilder<S>
[src]
Begin constructing an Endpoint
pub fn connect(
&self,
addr: &SocketAddr,
server_name: &str
) -> Result<Connecting<S>, ConnectError>
[src]
&self,
addr: &SocketAddr,
server_name: &str
) -> Result<Connecting<S>, ConnectError>
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]
&self,
config: ClientConfig<S>,
addr: &SocketAddr,
server_name: &str
) -> Result<Connecting<S>, ConnectError>
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 close()
and dropping the Incoming
stream if
that is desired.
Trait Implementations
impl<S> Clone for Endpoint<S> where
S: Session,
[src]
S: Session,
fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<S: Debug> Debug for Endpoint<S> where
S: Session,
[src]
S: Session,
Auto Trait Implementations
impl<S> !RefUnwindSafe for Endpoint<S>
impl<S> Send for Endpoint<S> where
<S as Session>::ClientConfig: Send,
<S as Session>::ClientConfig: Send,
impl<S> Sync for Endpoint<S> where
<S as Session>::ClientConfig: Sync,
<S as Session>::ClientConfig: Sync,
impl<S> Unpin for Endpoint<S> where
<S as Session>::ClientConfig: Unpin,
<S as Session>::ClientConfig: Unpin,
impl<S> !UnwindSafe for Endpoint<S>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut 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.
pub 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.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,