AsyncTcpStream

Struct AsyncTcpStream 

Source
pub struct AsyncTcpStream(/* private fields */);
Available on crate feature net only.

Implementations§

Source§

impl AsyncTcpStream

Source

pub async fn connect_addr(addr: SocketAddr) -> Result<AsyncTcpStream>

Source

pub async fn connect( addr: impl ToSocketAddrs + Send + UnwindSafe + 'static, ) -> Result<AsyncTcpStream>

Source

pub async fn peek(&self, buf: BytesMut) -> Result<RecvMsg>

Available on crate feature io only.
Source

pub async fn peek_to_bytes(&self, len: usize) -> Result<Bytes>

Available on crate feature io only.
Source

pub fn peer_addr(&self) -> Result<SocketAddr>

Source

pub async fn shutdown(&self, how: Shutdown) -> Result<()>

Source

pub fn nodelay(&self) -> Result<bool>

Source

pub fn set_nodelay(&self, nodelay: bool) -> Result<()>

Source

pub fn read_timeout(&self) -> Result<Option<Duration>>

Source

pub fn set_read_timeout(&self, dur: Option<Duration>) -> Result<()>

Source

pub fn write_timeout(&self) -> Result<Option<Duration>>

Source

pub fn set_write_timeout(&self, dur: Option<Duration>) -> Result<()>

Source

pub fn ttl(&self) -> Result<u32>

Source

pub fn set_ttl(&self, ttl: u32) -> Result<()>

Source

pub fn linger(&self) -> Result<Option<Duration>>

Available on crate feature nightly only.
Source

pub fn set_linger(&self, dur: Option<Duration>) -> Result<()>

Available on crate feature nightly only.
Source

pub fn take_error(&self) -> Result<Option<Error>>

Source

pub fn local_addr(&self) -> Result<SocketAddr>

Source

pub async fn close(self) -> Result<()>

Source

pub fn try_unwrap(self) -> StdResult<RawAsyncSocket, AsyncTcpStream>

Source

pub fn get_raw_weak(&self) -> Weak<RawAsyncSocket>

Source

pub fn try_clone(&self) -> Result<AsyncTcpStream>

Trait Implementations§

Source§

impl AsFd for AsyncTcpStream

Available on Unix only.
Source§

fn as_fd(&self) -> BorrowedFd<'_>

Borrows the file descriptor. Read more
Source§

impl AsRawFd for AsyncTcpStream

Available on Unix only.
Source§

fn as_raw_fd(&self) -> RawFd

Extracts the raw file descriptor. Read more
Source§

impl AsyncRead for AsyncTcpStream

Available on crate feature io only.
Source§

type Future = Read

Source§

fn read(&self, buf: BytesMut) -> Read

Source§

impl AsyncReadVectored for AsyncTcpStream

Available on crate feature io only.
Source§

impl AsyncWrite for AsyncTcpStream

Available on crate feature io only.
Source§

type Future = Write

Source§

fn write(&self, buf: Bytes) -> Write

Source§

impl AsyncWriteVectored for AsyncTcpStream

Available on crate feature io only.
Source§

impl Debug for AsyncTcpStream

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<RawAsyncFile> for AsyncTcpStream

Source§

fn from(socket: RawAsyncSocket) -> AsyncTcpStream

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<A> AsyncReadExt for A
where A: AsyncRead,

Source§

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>

Available on crate feature io only.
Source§

fn read_exact(&self, buf: BytesMut) -> ReadExact<'_, A>

Available on crate feature io only.
Source§

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>

Available on crate feature io only.
Source§

fn read_exact_to_bytes(&self, len: usize) -> ReadExactToBytes<'_, A>

Available on crate feature io only.
Source§

impl<W> AsyncWriteExt for W
where W: AsyncWrite,

Source§

fn write_all(&self, bytes: Bytes) -> WriteAll<'_, W>

Available on crate feature io only.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.