Struct trust_dns_proto::xfer::SerialMessage
source · [−]pub struct SerialMessage { /* private fields */ }
Expand description
A DNS message in serialized form, with either the target address or source address
Implementations
sourceimpl SerialMessage
impl SerialMessage
sourcepub fn new(message: Vec<u8>, addr: SocketAddr) -> Self
pub fn new(message: Vec<u8>, addr: SocketAddr) -> Self
Construct a new SerialMessage and the source or destination address
sourcepub fn bytes(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub fn bytes(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
Get a reference to the bytes
sourcepub fn addr(&self) -> SocketAddr
pub fn addr(&self) -> SocketAddr
Get the source or destination address (context dependent)
sourcepub fn into_parts(self) -> (Vec<u8>, SocketAddr)
pub fn into_parts(self) -> (Vec<u8>, SocketAddr)
Unwrap the Bytes and address
sourcepub fn from_parts(message: Vec<u8>, addr: SocketAddr) -> Self
pub fn from_parts(message: Vec<u8>, addr: SocketAddr) -> Self
Build a SerialMessage
from some bytes and an address
sourcepub fn to_message(&self) -> ProtoResult<Message>
pub fn to_message(&self) -> ProtoResult<Message>
Deserializes the inner data into a Message
Trait Implementations
sourceimpl From<(Vec<u8, Global>, SocketAddr)> for SerialMessage
impl From<(Vec<u8, Global>, SocketAddr)> for SerialMessage
sourcefn from((message, addr): (Vec<u8>, SocketAddr)) -> Self
fn from((message, addr): (Vec<u8>, SocketAddr)) -> Self
Converts to this type from the input type.
sourceimpl From<SerialMessage> for (Vec<u8>, SocketAddr)
impl From<SerialMessage> for (Vec<u8>, SocketAddr)
sourcefn from(msg: SerialMessage) -> Self
fn from(msg: SerialMessage) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl RefUnwindSafe for SerialMessage
impl Send for SerialMessage
impl Sync for SerialMessage
impl Unpin for SerialMessage
impl UnwindSafe for SerialMessage
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