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

authority: Vec<Resource<'a>>

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>

Constructs a new Message with a random id value.

fn with_id(id: u16) -> Message<'a>

Constructs a new Message with the given id value.

fn decode(data: &[u8]) -> Result<MessageDecodeError>

Decodes a message from a series of bytes.

fn encode<'buf>(&self, buf: &'buf mut [u8]) -> Result<&'buf [u8]EncodeError>

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>

Returns a DnsError if the message response code is an error.

fn records(&self) -> RecordIter

Returns an iterator over the records in this message.

fn into_records(self) -> RecordIntoIter<'a>

Consumes the message and returns an iterator over its records.

Trait Implementations

impl<'a> PartialEq for Message<'a>
[src]

fn eq(&self, __arg_0: &Message<'a>) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &Message<'a>) -> bool

This method tests for !=.

impl<'a> Eq for Message<'a>
[src]

impl<'a> Default for Message<'a>
[src]

fn default() -> Message<'a>

Returns the "default value" for a type. Read more

impl<'a> Debug for Message<'a>
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl<'a> Clone for Message<'a>
[src]

fn clone(&self) -> Message<'a>

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more