Struct trust_dns_proto::xfer::dns_multiplexer::DnsMultiplexer[][src]

#[must_use = "futures do nothing unless polled"]pub struct DnsMultiplexer<S, MF, D = Box<dyn DnsStreamHandle>> where
    D: Send + 'static,
    S: DnsClientStream + 'static,
    MF: MessageFinalizer
{ /* fields omitted */ }

A DNS Client implemented over futures-rs.

This Client is generic and capable of wrapping UDP, TCP, and other underlying DNS protocol implementations. This should be used for underlying protocols that do not natively support multiplexed sessions.

Implementations

impl<S, MF> DnsMultiplexer<S, MF, Box<dyn DnsStreamHandle>> where
    S: DnsClientStream + Unpin + 'static,
    MF: MessageFinalizer
[src]

pub fn new<F>(
    stream: F,
    stream_handle: Box<dyn DnsStreamHandle>,
    signer: Option<Arc<MF>>
) -> DnsMultiplexerConnect<F, S, MF>

Notable traits for DnsMultiplexerConnect<F, S, MF>

impl<F, S, MF> Future for DnsMultiplexerConnect<F, S, MF> where
    F: Future<Output = Result<S, ProtoError>> + Send + Unpin + 'static,
    S: DnsClientStream + Unpin + 'static,
    MF: MessageFinalizer + Send + Sync + 'static, 
type Output = Result<DnsMultiplexer<S, MF, Box<dyn DnsStreamHandle>>, ProtoError>;
where
    F: Future<Output = Result<S, ProtoError>> + Send + Unpin + 'static, 
[src]

Spawns a new DnsMultiplexer Stream. This uses a default timeout of 5 seconds for all requests.

Arguments

  • stream - A stream of bytes that can be used to send/receive DNS messages (see TcpClientStream or UdpClientStream)
  • stream_handle - The handle for the stream on which bytes can be sent/received.
  • signer - An optional signer for requests, needed for Updates with Sig0, otherwise not needed

pub fn with_timeout<F>(
    stream: F,
    stream_handle: Box<dyn DnsStreamHandle>,
    timeout_duration: Duration,
    signer: Option<Arc<MF>>
) -> DnsMultiplexerConnect<F, S, MF>

Notable traits for DnsMultiplexerConnect<F, S, MF>

impl<F, S, MF> Future for DnsMultiplexerConnect<F, S, MF> where
    F: Future<Output = Result<S, ProtoError>> + Send + Unpin + 'static,
    S: DnsClientStream + Unpin + 'static,
    MF: MessageFinalizer + Send + Sync + 'static, 
type Output = Result<DnsMultiplexer<S, MF, Box<dyn DnsStreamHandle>>, ProtoError>;
where
    F: Future<Output = Result<S, ProtoError>> + Send + Unpin + 'static, 
[src]

Spawns a new DnsMultiplexer Stream.

Arguments

  • stream - A stream of bytes that can be used to send/receive DNS messages (see TcpClientStream or UdpClientStream)
  • timeout_duration - All requests may fail due to lack of response, this is the time to wait for a response before canceling the request.
  • stream_handle - The handle for the stream on which bytes can be sent/received.
  • signer - An optional signer for requests, needed for Updates with Sig0, otherwise not needed

Trait Implementations

impl<S, MF> Display for DnsMultiplexer<S, MF> where
    S: DnsClientStream + 'static,
    MF: MessageFinalizer + Send + Sync + 'static, 
[src]

impl<S, MF> DnsRequestSender for DnsMultiplexer<S, MF> where
    S: DnsClientStream + Unpin + 'static,
    MF: MessageFinalizer + Send + Sync + 'static, 
[src]

impl<S, MF> Stream for DnsMultiplexer<S, MF> where
    S: DnsClientStream + Unpin + 'static,
    MF: MessageFinalizer + Send + Sync + 'static, 
[src]

type Item = Result<(), ProtoError>

Values yielded by the stream.

Auto Trait Implementations

impl<S, MF, D = Box<dyn DnsStreamHandle + 'static, Global>> !RefUnwindSafe for DnsMultiplexer<S, MF, D>

impl<S, MF, D> Send for DnsMultiplexer<S, MF, D>

impl<S, MF, D = Box<dyn DnsStreamHandle + 'static, Global>> !Sync for DnsMultiplexer<S, MF, D>

impl<S, MF, D> Unpin for DnsMultiplexer<S, MF, D> where
    D: Unpin,
    S: Unpin

impl<S, MF, D = Box<dyn DnsStreamHandle + 'static, Global>> !UnwindSafe for DnsMultiplexer<S, MF, D>

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> ToString for T where
    T: Display + ?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>,