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
sourceimpl From<SerialMessage> for (Vec<u8>, SocketAddr)
impl From<SerialMessage> for (Vec<u8>, SocketAddr)
sourcefn from(msg: SerialMessage) -> Self
fn from(msg: SerialMessage) -> Self
Performs the conversion.
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