pub struct TcpListener(/* private fields */);
Implementations§
Source§impl TcpListener
impl TcpListener
Sourcepub fn bind(addr: &SocketAddress) -> Result<Self>
pub fn bind(addr: &SocketAddress) -> Result<Self>
Create a socket, bind to it, and listen on it, creating a TcpListener
at the provided address
§Errors
Various OS errors relating to permissions, and missing paths
Sourcepub fn local_addr(&self) -> Result<SocketAddress>
pub fn local_addr(&self) -> Result<SocketAddress>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TcpListener
impl RefUnwindSafe for TcpListener
impl Send for TcpListener
impl Sync for TcpListener
impl Unpin 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