Struct trust_dns_proto::xfer::BufDnsStreamHandle
source · [−]pub struct BufDnsStreamHandle { /* private fields */ }
Expand description
A buffering stream bound to a SocketAddr
This stream handle ensures that all messages sent via this handle have the remote_addr set as the destination for the packet
Implementations
sourceimpl BufDnsStreamHandle
impl BufDnsStreamHandle
sourcepub fn new(remote_addr: SocketAddr) -> (Self, StreamReceiver)
pub fn new(remote_addr: SocketAddr) -> (Self, StreamReceiver)
Constructs a new Buffered Stream Handle, used for sending data to the DNS peer.
Arguments
remote_addr
- the address of the remote DNS system (client or server)sender
- the handle being used to send data to the server
sourcepub fn with_remote_addr(&self, remote_addr: SocketAddr) -> Self
pub fn with_remote_addr(&self, remote_addr: SocketAddr) -> Self
Associates a different remote address for any responses.
This is mainly useful in server use cases where the incoming address is only known after receiving a packet.
Trait Implementations
sourceimpl Clone for BufDnsStreamHandle
impl Clone for BufDnsStreamHandle
sourcefn clone(&self) -> BufDnsStreamHandle
fn clone(&self) -> BufDnsStreamHandle
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl DnsStreamHandle for BufDnsStreamHandle
impl DnsStreamHandle for BufDnsStreamHandle
sourcefn send(&mut self, buffer: SerialMessage) -> Result<(), ProtoError>
fn send(&mut self, buffer: SerialMessage) -> Result<(), ProtoError>
Sends a message to the Handle for delivery to the server.
Auto Trait Implementations
impl !RefUnwindSafe for BufDnsStreamHandle
impl Send for BufDnsStreamHandle
impl Sync for BufDnsStreamHandle
impl Unpin for BufDnsStreamHandle
impl !UnwindSafe for BufDnsStreamHandle
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more