Struct trust_dns_proto::tcp::TcpStream[][src]

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

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

Implementations

impl<S: Connect> TcpStream<S>[src]

pub fn new<E>(
    name_server: SocketAddr
) -> (impl Future<Output = Result<TcpStream<S>, Error>> + Send, BufStreamHandle) where
    E: FromProtoError
[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(
    name_server: SocketAddr,
    timeout: Duration
) -> (impl Future<Output = Result<TcpStream<S>, Error>> + Send, BufStreamHandle)
[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: DnsTcpStream> TcpStream<S>[src]

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

Returns the address of the peer connection.

pub fn from_stream(stream: S, peer_addr: SocketAddr) -> (Self, 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(
    socket: S,
    peer_addr: SocketAddr,
    outbound_messages: StreamReceiver
) -> Self
[src]

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

Trait Implementations

impl<S: DnsTcpStream> Stream for TcpStream<S>[src]

type Item = Result<SerialMessage>

Values yielded by the stream.

Auto Trait Implementations

impl<S> !RefUnwindSafe for TcpStream<S>

impl<S> Send for TcpStream<S>

impl<S> Sync for TcpStream<S>

impl<S> Unpin for TcpStream<S>

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

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>,