Struct cap_async_std::net::TcpListener [−][src]
pub struct TcpListener { /* fields omitted */ }
A TCP socket server, listening for connections.
This corresponds to async_std::net::TcpListener
.
Note that this TcpListener
has no bind
method. To bind it to a socket
address, you must first obtain a Catalog
permitting the address, and
then call Catalog::bind_tcp_listener
.
Implementations
impl TcpListener
[src]
impl TcpListener
[src]pub unsafe fn from_std(std: TcpListener) -> Self
[src]
pub unsafe fn from_std(std: TcpListener) -> Self
[src]Constructs a new instance of Self
from the given async_std::net::TcpListener
.
Safety
async_std::net::TcpListener
is not sandboxed and may access any address that the host
process has access to.
pub fn local_addr(&self) -> Result<SocketAddr>
[src]
pub fn local_addr(&self) -> Result<SocketAddr>
[src]Returns the local socket address of this listener.
This corresponds to async_std::net::TcpListener::local_addr
.
pub async fn accept(&self) -> Result<(TcpStream, SocketAddr)>
[src]
pub async fn accept(&self) -> Result<(TcpStream, SocketAddr)>
[src]Accept a new incoming connection from this listener.
This corresponds to async_std::net::TcpListener::accept
.
pub fn incoming(&self) -> Incoming<'_>
[src]
pub fn incoming(&self) -> Incoming<'_>
[src]Returns an iterator over the connections being received on this listener.
This corresponds to async_std::net::TcpListener::incoming
.
Trait Implementations
impl AsRawFd for TcpListener
[src]
impl AsRawFd for TcpListener
[src]impl FromRawFd for TcpListener
[src]
impl FromRawFd for TcpListener
[src]unsafe fn from_raw_fd(fd: RawFd) -> Self
[src]
unsafe fn from_raw_fd(fd: RawFd) -> Self
[src]Constructs a new instance of Self
from the given raw file
descriptor. Read more
impl IntoRawFd for TcpListener
[src]
impl IntoRawFd for TcpListener
[src]fn into_raw_fd(self) -> RawFd
[src]
fn into_raw_fd(self) -> RawFd
[src]Consumes this object, returning the raw underlying file descriptor. Read more
impl OwnsRaw for TcpListener
[src]
Safety: TcpListener
wraps a net::TcpListener
which owns its handle.
Auto Trait Implementations
impl RefUnwindSafe for TcpListener
impl Send for TcpListener
impl Sync for TcpListener
impl Unpin for TcpListener
impl UnwindSafe for TcpListener
Blanket Implementations
impl<T> AsUnsafeFile for T where
T: AsRawFd + OwnsRaw,
[src]
impl<T> AsUnsafeFile for T where
T: AsRawFd + OwnsRaw,
[src]pub fn as_unsafe_file(&self) -> UnsafeFile
[src]
pub fn as_unsafe_file(&self) -> UnsafeFile
[src]Return the contained unsafe file.
fn as_file_view(&self) -> View<'_, File>
[src]
fn as_file_view(&self) -> View<'_, File>
[src]Utility for returning a value which dereferences to a &File
or
&mut File
. Read more
unsafe fn as_unscoped_file_view(&self) -> View<'static, File>
[src]
unsafe fn as_unscoped_file_view(&self) -> View<'static, File>
[src]Like as_file_view
, but returns a value which is not explicitly tied
to the lifetime of self
. Read more
impl<T> AsUnsafeHandle for T where
T: AsRawFd + OwnsRaw,
[src]
impl<T> AsUnsafeHandle for T where
T: AsRawFd + OwnsRaw,
[src]pub fn as_unsafe_handle(&self) -> UnsafeHandle
[src]
pub fn as_unsafe_handle(&self) -> UnsafeHandle
[src]Return the contained unsafe handle.
impl<T> AsUnsafeSocket for T where
T: AsRawFd + OwnsRaw,
[src]
impl<T> AsUnsafeSocket for T where
T: AsRawFd + OwnsRaw,
[src]pub fn as_unsafe_socket(&self) -> UnsafeSocket
[src]
pub fn as_unsafe_socket(&self) -> UnsafeSocket
[src]Return the contained unsafe socket.
fn as_tcp_stream_view(&self) -> View<'_, TcpStream>
[src]
fn as_tcp_stream_view(&self) -> View<'_, TcpStream>
[src]Utility for returning a value which dereferences to a &TcpStream
or
&mut TcpStream
. Read more
unsafe fn as_unscoped_tcp_stream_view(&self) -> View<'static, TcpStream>
[src]
unsafe fn as_unscoped_tcp_stream_view(&self) -> View<'static, TcpStream>
[src]Like as_tcp_stream_view
, but returns a value which is not explicitly
tied to the lifetime of self
. Read more
fn as_tcp_listener_view(&self) -> View<'_, TcpListener>
[src]
fn as_tcp_listener_view(&self) -> View<'_, TcpListener>
[src]Utility for returning a value which dereferences to a &TcpListener
or
&mut TcpListener
. Read more
unsafe fn as_unscoped_tcp_listener_view(&self) -> View<'static, TcpListener>
[src]
unsafe fn as_unscoped_tcp_listener_view(&self) -> View<'static, TcpListener>
[src]Like as_tcp_listener_view
, but returns a value which is not
explicitly tied to the lifetime of self
. Read more
fn as_udp_socket_view(&self) -> View<'_, UdpSocket>
[src]
fn as_udp_socket_view(&self) -> View<'_, UdpSocket>
[src]Utility for returning a value which dereferences to a &UdpSocket
or
&mut UdpSocket
. Read more
unsafe fn as_unscoped_udp_socket_view(&self) -> View<'static, UdpSocket>
[src]
unsafe fn as_unscoped_udp_socket_view(&self) -> View<'static, UdpSocket>
[src]Like as_udp_socket_view
, but returns a value which is not explicitly
tied to the lifetime of self
. Read more
fn as_unix_stream_view(&self) -> View<'_, UnixStream>
[src]
fn as_unix_stream_view(&self) -> View<'_, UnixStream>
[src]Utility for returning a value which dereferences to a &UnixStream
or
&mut UnixStream
. Read more
unsafe fn as_unscoped_unix_stream_view(&self) -> View<'static, UnixStream>
[src]
unsafe fn as_unscoped_unix_stream_view(&self) -> View<'static, UnixStream>
[src]Like as_unix_stream_view
, but returns a value which is not explicitly
tied to the lifetime of self
. Read more
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> FromUnsafeFile for T where
T: FromRawFd + OwnsRaw,
[src]
impl<T> FromUnsafeFile for T where
T: FromRawFd + OwnsRaw,
[src]pub unsafe fn from_unsafe_file(unsafe_file: UnsafeFile) -> T
[src]
pub unsafe fn from_unsafe_file(unsafe_file: UnsafeFile) -> T
[src]Convert an unsafe file into a Self
. Read more
fn from_filelike<Filelike>(filelike: Filelike) -> Self where
Filelike: IntoUnsafeFile,
[src]
fn from_filelike<Filelike>(filelike: Filelike) -> Self where
Filelike: IntoUnsafeFile,
[src]Convert from a type which implements IntoUnsafeFile
into a type that
implements FromUnsafeFile
. Read more
impl<T> FromUnsafeSocket for T where
T: FromRawFd + OwnsRaw,
[src]
impl<T> FromUnsafeSocket for T where
T: FromRawFd + OwnsRaw,
[src]pub unsafe fn from_unsafe_socket(unsafe_socket: UnsafeSocket) -> T
[src]
pub unsafe fn from_unsafe_socket(unsafe_socket: UnsafeSocket) -> T
[src]Convert an unsafe socket into a Self
. Read more
fn from_socketlike<Socketlike>(socketlike: Socketlike) -> Self where
Socketlike: IntoUnsafeSocket,
[src]
fn from_socketlike<Socketlike>(socketlike: Socketlike) -> Self where
Socketlike: IntoUnsafeSocket,
[src]Convert from a type which implements IntoUnsafeSocket
into a type
that implements FromUnsafeSocket
. Read more
impl<T> IntoUnsafeFile for T where
T: IntoRawFd + OwnsRaw,
[src]
impl<T> IntoUnsafeFile for T where
T: IntoRawFd + OwnsRaw,
[src]pub fn into_unsafe_file(self) -> UnsafeFile
[src]
pub fn into_unsafe_file(self) -> UnsafeFile
[src]Convert self
into an unsafe file.
impl<T> IntoUnsafeHandle for T where
T: IntoRawFd + OwnsRaw,
[src]
impl<T> IntoUnsafeHandle for T where
T: IntoRawFd + OwnsRaw,
[src]pub fn into_unsafe_handle(self) -> UnsafeHandle
[src]
pub fn into_unsafe_handle(self) -> UnsafeHandle
[src]Convert self
into an unsafe handle.
impl<T> IntoUnsafeSocket for T where
T: IntoRawFd + OwnsRaw,
[src]
impl<T> IntoUnsafeSocket for T where
T: IntoRawFd + OwnsRaw,
[src]pub fn into_unsafe_socket(self) -> UnsafeSocket
[src]
pub fn into_unsafe_socket(self) -> UnsafeSocket
[src]Convert self
into an unsafe socket.
impl<T> SetTimes for T where
T: AsUnsafeFile,
impl<T> SetTimes for T where
T: AsUnsafeFile,