Struct resolve::message::Message
[−]
[src]
pub struct Message<'a> { pub header: Header, pub question: Vec<Question>, pub answer: Vec<Resource<'a>>, pub authority: Vec<Resource<'a>>, pub additional: Vec<Resource<'a>>, }
Represents a DNS message.
Fields
header: Header
Describes the content of the remainder of the message.
question: Vec<Question>
Carries the question of query type messages.
answer: Vec<Resource<'a>>
Resource records that answer the query
Resource records that point to an authoritative name server
additional: Vec<Resource<'a>>
Resource records that relate to the query, but are not strictly answers for the question.
Methods
impl<'a> Message<'a>
[src]
fn new() -> Message<'a>
[src]
Constructs a new Message
with a random id value.
fn with_id(id: u16) -> Message<'a>
[src]
Constructs a new Message
with the given id value.
fn decode(data: &[u8]) -> Result<Message, DecodeError>
[src]
Decodes a message from a series of bytes.
fn encode<'buf>(&self, buf: &'buf mut [u8]) -> Result<&'buf [u8], EncodeError>
[src]
Encodes a message to a series of bytes. On success, returns a subslice of the given buffer containing only the encoded message bytes.
fn get_error(&self) -> Result<(), DnsError>
[src]
Returns a DnsError
if the message response code is an error.
fn records(&self) -> RecordIter
[src]
Returns an iterator over the records in this message.
fn into_records(self) -> RecordIntoIter<'a>
[src]
Consumes the message and returns an iterator over its records.
Trait Implementations
impl<'a> Clone for Message<'a>
[src]
fn clone(&self) -> Message<'a>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more