pub struct Endpoint { /* private fields */ }Expand description
One quinn endpoint per pre-bound socket, all feeding one session queue.
Implementations§
Source§impl Endpoint
impl Endpoint
Sourcepub fn bind(
socks: Vec<UdpSocket>,
cert: &Cert,
cfg: TransportConfig,
) -> Result<Endpoint>
pub fn bind( socks: Vec<UdpSocket>, cert: &Cert, cfg: TransportConfig, ) -> Result<Endpoint>
Serve on already-bound UDP sockets (the caller binds them, runs STUN on them, and hands them over; they are never rebound).
Sourcepub async fn accept(&self) -> Option<Session>
pub async fn accept(&self) -> Option<Session>
Next accepted WebTransport session, or None once the endpoint is closed.
Sourcepub fn rotate(&self, cert: &Cert) -> Result<()>
pub fn rotate(&self, cert: &Cert) -> Result<()>
Install a new certificate for future connections. Existing QUIC
sessions carry their own completed TLS state and are untouched
(quinn::Endpoint::set_server_config applies to new handshakes only).
pub fn local_addrs(&self) -> &[SocketAddr]
Sourcepub fn prober(&self, index: usize) -> Option<&Prober>
pub fn prober(&self, index: usize) -> Option<&Prober>
Hole-punch prober bound to socket index (same order as bind).
Sourcepub fn socket_index_for(&self, ip: IpAddr) -> Option<usize>
pub fn socket_index_for(&self, ip: IpAddr) -> Option<usize>
Index of the socket whose address family matches ip.
pub fn close(&self)
Auto Trait Implementations§
impl !Freeze for Endpoint
impl !RefUnwindSafe for Endpoint
impl !UnwindSafe for Endpoint
impl Send for Endpoint
impl Sync for Endpoint
impl Unpin for Endpoint
impl UnsafeUnpin for Endpoint
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more