pub struct UniListener { /* private fields */ }Expand description
A simple wrapper of tokio::net::TcpListener.
Implementations§
Source§impl UniListener
impl UniListener
Sourcepub async fn accept(&self) -> Result<(UniStream, UniAddr)>
pub async fn accept(&self) -> Result<(UniStream, UniAddr)>
Accepts an incoming connection to this listener, and returns the accepted stream and the peer address.
This method will retry on non-deadly errors, including:
ECONNREFUSED.ECONNABORTED.ECONNRESET.
Sourcepub fn poll_accept(
&self,
cx: &mut Context<'_>,
) -> Poll<Result<(UniStream, UniAddr)>>
pub fn poll_accept( &self, cx: &mut Context<'_>, ) -> Poll<Result<(UniStream, UniAddr)>>
Accepts an incoming connection to this listener, and returns the accepted stream and the peer address.
Notes that on multiple calls to poll_accept, only
the waker from the Context passed to the most recent call is
scheduled to receive a wakeup. Unless you are implementing your own
future accepting connections, you probably want to use the asynchronous
accept method instead.
Sourcepub fn local_addr(&self) -> Result<UniAddr>
pub fn local_addr(&self) -> Result<UniAddr>
Sourcepub fn as_socket_ref(&self) -> SockRef<'_>
pub fn as_socket_ref(&self) -> SockRef<'_>
Returns a SockRef to the underlying socket for configuration.
Trait Implementations§
Source§impl Debug for UniListener
impl Debug for UniListener
Source§impl TryFrom<TcpListener> for UniListener
impl TryFrom<TcpListener> for UniListener
Source§impl TryFrom<TcpListener> for UniListener
impl TryFrom<TcpListener> for UniListener
Auto Trait Implementations§
impl !Freeze for UniListener
impl RefUnwindSafe for UniListener
impl Send for UniListener
impl Sync for UniListener
impl Unpin for UniListener
impl UnwindSafe for UniListener
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