Struct libp2p_rs::runtime::net::TcpStream[][src]

pub struct TcpStream(_);

Implementations

impl TcpStream[src]

pub async fn connect<A>(addrs: A) -> Result<TcpStream, Error> where
    A: ToSocketAddrs, 
[src]

Creates a new TCP stream connected to the specified address.

pub fn inner_mut(&mut self) -> &mut TcpStream[src]

Gets the inner mutable TcpStream.

pub fn local_addr(&self) -> Result<SocketAddr, Error>[src]

Returns the local address that this stream is connected to.

pub fn peer_addr(&self) -> Result<SocketAddr, Error>[src]

Returns the remote address that this stream is connected to.

pub fn ttl(&self) -> Result<u32, Error>[src]

Gets the value of the IP_TTL option for this socket.

pub fn set_ttl(&self, ttl: u32) -> Result<(), Error>[src]

Sets the value for the IP_TTL option on this socket.

pub fn nodelay(&self) -> Result<bool, Error>[src]

Gets the value of the TCP_NODELAY option on this socket.

pub fn set_nodelay(&self, nodelay: bool) -> Result<(), Error>[src]

Sets the value of the TCP_NODELAY option on this socket.

Trait Implementations

impl AsyncRead for TcpStream[src]

impl AsyncWrite for TcpStream[src]

impl Debug for TcpStream[src]

impl From<TcpStream> for TcpStream[src]

pub fn from(stream: TcpStream) -> TcpStream[src]

Converts a std::net::TcpStream into its asynchronous equivalent.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<R> AsyncReadExt for R where
    R: AsyncRead + ?Sized

impl<R> AsyncReadExt for R where
    R: AsyncRead + ?Sized

impl<W> AsyncWriteExt for W where
    W: AsyncWrite + ?Sized

impl<W> AsyncWriteExt for W where
    W: AsyncWrite + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> ReadEx for T where
    T: AsyncRead + Unpin + Send
[src]

impl<T> ReadExt for T where
    T: AsyncRead + ?Sized

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WriteEx for T where
    T: AsyncWrite + Unpin + Send
[src]

impl<T> WriteExt for T where
    T: AsyncWrite + ?Sized