pub struct AsyncTcpStream(/* private fields */);Available on crate feature
net only.Implementations§
Source§impl AsyncTcpStream
impl AsyncTcpStream
pub async fn connect_addr(addr: SocketAddr) -> Result<AsyncTcpStream>
pub async fn connect( addr: impl ToSocketAddrs + Send + UnwindSafe + 'static, ) -> Result<AsyncTcpStream>
pub async fn peek(&self, buf: BytesMut) -> Result<RecvMsg>
Available on crate feature
io only.pub async fn peek_to_bytes(&self, len: usize) -> Result<Bytes>
Available on crate feature
io only.pub fn peer_addr(&self) -> Result<SocketAddr>
pub async fn shutdown(&self, how: Shutdown) -> Result<()>
pub fn nodelay(&self) -> Result<bool>
pub fn set_nodelay(&self, nodelay: bool) -> Result<()>
pub fn read_timeout(&self) -> Result<Option<Duration>>
pub fn set_read_timeout(&self, dur: Option<Duration>) -> Result<()>
pub fn write_timeout(&self) -> Result<Option<Duration>>
pub fn set_write_timeout(&self, dur: Option<Duration>) -> Result<()>
pub fn ttl(&self) -> Result<u32>
pub fn set_ttl(&self, ttl: u32) -> Result<()>
pub fn linger(&self) -> Result<Option<Duration>>
Available on crate feature
nightly only.pub fn set_linger(&self, dur: Option<Duration>) -> Result<()>
Available on crate feature
nightly only.pub fn take_error(&self) -> Result<Option<Error>>
pub fn local_addr(&self) -> Result<SocketAddr>
pub async fn close(self) -> Result<()>
pub fn try_unwrap(self) -> StdResult<RawAsyncSocket, AsyncTcpStream>
pub fn get_raw_weak(&self) -> Weak<RawAsyncSocket>
pub fn try_clone(&self) -> Result<AsyncTcpStream>
Trait Implementations§
Source§impl AsFd for AsyncTcpStream
Available on Unix only.
impl AsFd for AsyncTcpStream
Available on Unix only.
Source§fn as_fd(&self) -> BorrowedFd<'_>
fn as_fd(&self) -> BorrowedFd<'_>
Borrows the file descriptor. Read more
Source§impl AsRawFd for AsyncTcpStream
Available on Unix only.
impl AsRawFd for AsyncTcpStream
Available on Unix only.
Source§impl AsyncRead for AsyncTcpStream
Available on crate feature io only.
impl AsyncRead for AsyncTcpStream
Available on crate feature
io only.Source§impl AsyncReadVectored for AsyncTcpStream
Available on crate feature io only.
impl AsyncReadVectored for AsyncTcpStream
Available on crate feature
io only.type Future = ReadVectored
fn read_vectored(&self, buffers: Vec<BytesMut>) -> ReadVectored ⓘ
Source§impl AsyncWrite for AsyncTcpStream
Available on crate feature io only.
impl AsyncWrite for AsyncTcpStream
Available on crate feature
io only.Source§impl AsyncWriteVectored for AsyncTcpStream
Available on crate feature io only.
impl AsyncWriteVectored for AsyncTcpStream
Available on crate feature
io only.Source§impl Debug for AsyncTcpStream
impl Debug for AsyncTcpStream
Source§impl From<RawAsyncFile> for AsyncTcpStream
impl From<RawAsyncFile> for AsyncTcpStream
Source§fn from(socket: RawAsyncSocket) -> AsyncTcpStream
fn from(socket: RawAsyncSocket) -> AsyncTcpStream
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for AsyncTcpStream
impl RefUnwindSafe for AsyncTcpStream
impl !Send for AsyncTcpStream
impl !Sync for AsyncTcpStream
impl Unpin for AsyncTcpStream
impl UnwindSafe for AsyncTcpStream
Blanket Implementations§
Source§impl<A> AsyncReadExt for Awhere
A: AsyncRead,
impl<A> AsyncReadExt for Awhere
A: AsyncRead,
Source§fn read_appending(
&self,
bytes: BytesMut,
len: usize,
) -> ReadAppending<<A as AsyncRead>::Future> ⓘ
fn read_appending( &self, bytes: BytesMut, len: usize, ) -> ReadAppending<<A as AsyncRead>::Future> ⓘ
Available on crate feature
io only.Source§fn read_all_appending(&self, bytes: BytesMut) -> ReadAllAppending<'_, A> ⓘ
fn read_all_appending(&self, bytes: BytesMut) -> ReadAllAppending<'_, A> ⓘ
Available on crate feature
io only.Source§fn read_to_bytes(&self, len: usize) -> ReadToBytesAt<<A as AsyncRead>::Future> ⓘ
fn read_to_bytes(&self, len: usize) -> ReadToBytesAt<<A as AsyncRead>::Future> ⓘ
Available on crate feature
io only.Source§fn read_all_to_bytes(&self) -> ReadAllToBytes<'_, A> ⓘ
fn read_all_to_bytes(&self) -> ReadAllToBytes<'_, A> ⓘ
Available on crate feature
io only.Source§fn read_exact_to_bytes(&self, len: usize) -> ReadExactToBytes<'_, A> ⓘ
fn read_exact_to_bytes(&self, len: usize) -> ReadExactToBytes<'_, A> ⓘ
Available on crate feature
io only.Source§impl<W> AsyncWriteExt for Wwhere
W: AsyncWrite,
impl<W> AsyncWriteExt for Wwhere
W: AsyncWrite,
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