pub struct TcpListener { /* private fields */ }
Expand description

Async wrapper around std::net::TcpListener.

You can borrow the inner struct with inner and inner_mut.

Implementations

Wraps an existing listener socket so we can perform async operations on it.

Errors

Returns any Err(std::io::Error) returned by std::net::TcpListener::set_nonblocking.

Returns a TCP listener socket, bound to addr, that is ready to accept connections.

Errors

Returns any Err(std::io::Error) returned by the underlying std::net::TcpListener::bind method.

Makes a new handle to this socket.

Errors

Returns any Err(std::io::Error) returned by the underlying std::net::TcpListener::try_clone method.

Waits for a new connection and then accepts it. Returns the address of the remote side of the connection and a stream for reading and writing the connection.

Errors

Returns an error if it fails to create a new socket. This happens when the process runs out of file descriptors.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.