pub struct Listener { /* private fields */ }Expand description
Listens for incoming WebSocket connections on a TCP port.
Use with crate::Server::with_websocket to accept WebSocket connections
alongside QUIC connections on a separate port.
Implementations§
Source§impl Listener
impl Listener
Sourcepub async fn bind(addr: SocketAddr) -> Result<Self, Error>
pub async fn bind(addr: SocketAddr) -> Result<Self, Error>
Bind a listener to the given address, accepting every moq ALPN we know about.
Sourcepub async fn bind_with_alpns(
addr: SocketAddr,
alpns: &[&str],
) -> Result<Self, Error>
pub async fn bind_with_alpns( addr: SocketAddr, alpns: &[&str], ) -> Result<Self, Error>
Bind a listener that only accepts the given moq ALPNs, in preference order.
Sourcepub fn local_addr(&self) -> Result<SocketAddr, Error>
pub fn local_addr(&self) -> Result<SocketAddr, Error>
The local address the listener is bound to.
Auto Trait Implementations§
impl !Freeze for Listener
impl RefUnwindSafe for Listener
impl Send for Listener
impl Sync for Listener
impl Unpin for Listener
impl UnsafeUnpin for Listener
impl UnwindSafe for Listener
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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