pub struct QuicListener { /* private fields */ }Expand description
Listening endpoint for inbound QUIC connections.
Holding this alive keeps the bound UDP socket open; dropping it closes the endpoint (the OS releases the port).
Implementations§
Source§impl QuicListener
impl QuicListener
Sourcepub fn bind(scheme: &str, host: &str, port: u16) -> Result<Self>
pub fn bind(scheme: &str, host: &str, port: u16) -> Result<Self>
Bind a new listener at host:port, honoring the address-family
hint quic4 / quic6 / quic encoded in scheme. Passing
port 0 requests an ephemeral port from the OS; the caller can
read the assigned port back via local_addr.
Sourcepub fn local_addr(&self) -> Result<SocketAddr>
pub fn local_addr(&self) -> Result<SocketAddr>
The locally-bound socket address. Useful for reading back the
OS-assigned ephemeral port after binding with port 0.
Trait Implementations§
Source§impl Drop for QuicListener
impl Drop for QuicListener
Auto Trait Implementations§
impl !RefUnwindSafe for QuicListener
impl !UnwindSafe for QuicListener
impl Freeze for QuicListener
impl Send for QuicListener
impl Sync for QuicListener
impl Unpin for QuicListener
impl UnsafeUnpin for QuicListener
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