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§
source§impl 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 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§
source§impl From<(Vec<u8, Global>, SocketAddr)> for SerialMessage
impl From<(Vec<u8, Global>, SocketAddr)> for SerialMessage
source§impl From<SerialMessage> for (Vec<u8>, SocketAddr)
impl From<SerialMessage> for (Vec<u8>, SocketAddr)
source§fn 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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more