pub struct TcpListener { /* private fields */ }Expand description
A goroutine-aware TCP server socket.
Calls to accept park the current goroutine when no
connection is immediately available and resume it when one arrives.
Implementations§
Source§impl TcpListener
impl TcpListener
Sourcepub fn bind<A: ToSocketAddrs>(addr: A) -> Result<Self>
pub fn bind<A: ToSocketAddrs>(addr: A) -> Result<Self>
Bind a non-blocking TCP listener to addr.
Equivalent to net.Listen("tcp", addr) in Go.
Trait Implementations§
Source§impl Drop for TcpListener
impl Drop for TcpListener
Auto Trait Implementations§
impl Freeze for TcpListener
impl RefUnwindSafe for TcpListener
impl Send for TcpListener
impl Sync for TcpListener
impl Unpin for TcpListener
impl UnsafeUnpin for TcpListener
impl UnwindSafe for TcpListener
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