pub struct Listener {
endpoint: Endpoint,
}Expand description
A QUIC listener that accepts incoming connections and detects the negotiated ALPN protocol.
Fields§
§endpoint: EndpointImplementations§
Source§impl Listener
impl Listener
Sourcepub fn bind(config: ListenerConfig) -> Result<Self, ProxyError>
pub fn bind(config: ListenerConfig) -> Result<Self, ProxyError>
Bind to the configured address and start listening.
Sourcepub async fn accept(&self) -> Result<(Connection, Vec<u8>), ProxyError>
pub async fn accept(&self) -> Result<(Connection, Vec<u8>), ProxyError>
Accept the next incoming QUIC connection.
Returns the quinn::Connection and the negotiated ALPN protocol.
Sourcepub fn local_addr(&self) -> Result<SocketAddr, ProxyError>
pub fn local_addr(&self) -> Result<SocketAddr, ProxyError>
Get the local address this 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<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