[−][src]Struct cap_async_std::net::TcpStream
A TCP stream between a local and a remote socket.
This corresponds to async_std::net::TcpStream
.
Note that this TcpStream
has no connect
method. To create a TcpStream
,
you must first obtain a Catalog
permitting the address, and then call
Catalog::connect_tcp_stream
.
Implementations
impl TcpStream
[src][−]
pub unsafe fn from_std(std: TcpStream) -> Self
[src][−]
Constructs a new instance of Self
from the given async_std::net::TcpStream
.
Safety
async_std::net::TcpStream
is not sandboxed and may access any address that the host
process has access to.
pub fn local_addr(&self) -> Result<SocketAddr>
[src][−]
Returns the local socket address of this listener.
This corresponds to async_std::net::TcpStream::local_addr
.
pub fn shutdown(&self, how: Shutdown) -> Result<()>
[src][−]
Shuts down the read, write, or both halves of this connection.
This corresponds to async_std::net::TcpStream::shutdown
.
pub async fn peek<'_, '_>(&'_ self, buf: &'_ mut [u8]) -> Result<usize>
[src][−]
Receives data on the socket from the remote address to which it is connected, without removing that data from the queue.
This corresponds to async_std::net::TcpStream::peek
.
pub fn set_nodelay(&self, nodelay: bool) -> Result<()>
[src][−]
Sets the value of the TCP_NODELAY
option on this socket.
This corresponds to async_std::net::TcpStream::set_nodelay
.
pub fn nodelay(&self) -> Result<bool>
[src][−]
Gets the value of the TCP_NODELAY
option on this socket.
This corresponds to async_std::net::TcpStream::nodelay
.
pub fn set_ttl(&self, ttl: u32) -> Result<()>
[src][−]
Sets the value for the IP_TTL
option on this socket.
This corresponds to async_std::net::TcpStream::set_ttl
.
pub fn ttl(&self) -> Result<u32>
[src][−]
Gets the value of the IP_TTL
option for this socket.
This corresponds to async_std::net::TcpStream::ttl
.
Trait Implementations
impl AsRawFd for TcpStream
[src][+]
impl AsyncRead for TcpStream
[src][+]
impl<'_> AsyncRead for &'_ TcpStream
[src][+]
impl AsyncWrite for TcpStream
[src][+]
impl<'_> AsyncWrite for &'_ TcpStream
[src][+]
impl FromRawFd for TcpStream
[src][+]
impl IntoRawFd for TcpStream
[src][+]
Auto Trait Implementations
impl RefUnwindSafe for TcpStream
impl Send for TcpStream
impl Sync for TcpStream
impl Unpin for TcpStream
impl UnwindSafe for TcpStream
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<R> AsyncReadExt for R where
R: AsyncRead + ?Sized,
[+]
R: AsyncRead + ?Sized,
impl<W> AsyncWriteExt for W where
W: AsyncWrite + ?Sized,
[+]
W: AsyncWrite + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> ReadExt for T where
T: AsyncRead + ?Sized,
[src][+]
T: AsyncRead + ?Sized,
impl<T> SetTimes for T where
T: AsRawFd,
[+]
T: AsRawFd,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<T> WriteExt for T where
T: AsyncWrite + ?Sized,
[src][+]
T: AsyncWrite + ?Sized,