Struct lunatic::net::TcpStream[][src]

pub struct TcpStream { /* fields omitted */ }

A TCP connection.

A TcpStream can be created by connecting to an endpoint or by accepting an incoming connection.

TcpStream is a bidirectional stream that implements traits Read and Write.

Cloning a TcpStream creates another handle to the same socket. The socket will be closed when all handles to it are dropped.

The Transmission Control Protocol is specified in IETF RFC 793.

Implementations

impl TcpStream[src]

pub fn connect<A>(addr: A) -> Result<Self> where
    A: ToSocketAddrs
[src]

Creates a TCP connection to the specified address.

This method will create a new TCP socket and attempt to connect it to the provided addr,

If addr yields multiple addresses, connecting will be attempted with each of the addresses until connecting to one succeeds. If none of the addresses result in a successful connection, the error from the last connect attempt is returned.

Trait Implementations

impl Clone for TcpStream[src]

impl<'de> Deserialize<'de> for TcpStream[src]

impl Read for TcpStream[src]

impl Serialize for TcpStream[src]

impl Write for TcpStream[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

impl<R> ReadBytesExt for R where
    R: Read + ?Sized

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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<W> WriteBytesExt for W where
    W: Write + ?Sized