pub struct Listener { /* private fields */ }Expand description
Listener for incoming connections.
Implementations§
Source§impl Listener
impl Listener
Sourcepub fn new(
registration: &Registration,
configuration: Configuration,
) -> Result<Self, ListenError>
pub fn new( registration: &Registration, configuration: Configuration, ) -> Result<Self, ListenError>
Create a new listener.
Sourcepub fn start<T: AsRef<[BufferRef]>>(
&self,
alpn: &T,
local_address: Option<SocketAddr>,
) -> Result<(), ListenError>
pub fn start<T: AsRef<[BufferRef]>>( &self, alpn: &T, local_address: Option<SocketAddr>, ) -> Result<(), ListenError>
Start the listener.
Sourcepub fn poll_accept(
&self,
cx: &mut Context<'_>,
) -> Poll<Result<Connection, ListenError>>
pub fn poll_accept( &self, cx: &mut Context<'_>, ) -> Poll<Result<Connection, ListenError>>
Poll to accept a new connection.
Sourcepub fn poll_stop(&self, cx: &mut Context<'_>) -> Poll<Result<(), ListenError>>
pub fn poll_stop(&self, cx: &mut Context<'_>) -> Poll<Result<(), ListenError>>
Poll to stop the listener.
Sourcepub fn local_addr(&self) -> Result<SocketAddr, ListenError>
pub fn local_addr(&self) -> Result<SocketAddr, ListenError>
Get the local address the listener is bound to.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Listener
impl RefUnwindSafe for Listener
impl Send for Listener
impl Sync for Listener
impl Unpin 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