[][src]Struct trust_dns_client::tcp::TcpStream

#[must_use = "futures do nothing unless polled"]pub struct TcpStream<S> { /* fields omitted */ }

A Stream used for sending data to and from a remote DNS endpoint (client or server).

Implementations

impl<S> TcpStream<S>[src]

pub fn peer_addr(&self) -> SocketAddr[src]

Returns the address of the peer connection.

impl<S> TcpStream<S> where
    S: 'static + Connect
[src]

pub fn new<E, TE>(
    name_server: SocketAddr
) -> (impl Send + Future<Output = Result<TcpStream<<S as Connect>::Transport>, Error>>, BufStreamHandle) where
    E: FromProtoError,
    TE: Time
[src]

Creates a new future of the eventually establish a IO stream connection or fail trying.

Defaults to a 5 second timeout

Arguments

  • name_server - the IP and Port of the DNS server to connect to

pub fn with_timeout<TE>(
    name_server: SocketAddr,
    timeout: Duration
) -> (impl Send + Future<Output = Result<TcpStream<<S as Connect>::Transport>, Error>>, BufStreamHandle) where
    TE: Time
[src]

Creates a new future of the eventually establish a IO stream connection or fail trying

Arguments

  • name_server - the IP and Port of the DNS server to connect to
  • timeout - connection timeout

impl<S> TcpStream<S> where
    S: AsyncRead + AsyncWrite
[src]

pub fn from_stream(
    stream: S,
    peer_addr: SocketAddr
) -> (TcpStream<S>, BufStreamHandle)
[src]

Initializes a TcpStream.

This is intended for use with a TcpListener and Incoming.

Arguments

  • stream - the established IO stream for communication
  • peer_addr - sources address of the stream

pub fn from_stream_with_receiver(
    stream: S,
    peer_addr: SocketAddr,
    receiver: UnboundedReceiver<SerialMessage>
) -> TcpStream<S>
[src]

Wraps a stream where a sender and receiver have already been established

Trait Implementations

impl<S> Stream for TcpStream<S> where
    S: Unpin + AsyncRead + AsyncWrite
[src]

type Item = Result<SerialMessage, Error>

Values yielded by the stream.

Auto Trait Implementations

impl<S> !RefUnwindSafe for TcpStream<S>

impl<S> Send for TcpStream<S> where
    S: Send

impl<S> Sync for TcpStream<S> where
    S: Sync

impl<S> Unpin for TcpStream<S> where
    S: Unpin

impl<S> !UnwindSafe for TcpStream<S>

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> From<T> for T[src]

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

impl<T> StreamExt for T where
    T: Stream + ?Sized
[src]

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<S, T, E> TryStream for S where
    S: Stream<Item = Result<T, E>> + ?Sized
[src]

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<S> TryStreamExt for S where
    S: TryStream + ?Sized
[src]

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