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> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more