Struct domain::bits::message::MessageBuf[][src]

pub struct MessageBuf { /* fields omitted */ }

An owned DNS message.

This type owns the underlying bytes of the message and derefs into a Message for all processing. For more information on DNS messages and how they can be accessed, please refer to the documentation of the Message type.

This is, however, not the type for building messages. Use [MessageBuilder] instead.

Methods

impl MessageBuf
[src]

Creates a new owned message using the given vector.

If the content of the vector is too short to even contain a full header, the function fails.

Creates a new owned message cloning the data from the bytes slice.

If the slice is too short to even contain a full header section, the function fails.

Returns a reference to the message slice.

Methods from Deref<Target = Message>

Returns an owned copy of this message.

Returns a reference to the underlying bytes slice.

Returns a reference to the message header.

Returns a mutable reference to the message header.

The header is the only part of an already constructed message that can be safely manipulated without extra ado, so this is the only mutable method.

Returns a reference to the header counts of the message.

Returns whether the rcode is NoError.

Returns whether the rcode is one of the error values.

Important traits for QuestionSection<'a>

Returns the question section.

Important traits for QuestionSection<'a>

Returns the zone section of an UPDATE message.

This is identical to self.question().

Returns the answer section.

Returns the prerequisite section of an UPDATE message.

This is identical to self.answer().

Returns the authority section.

Returns the update section of an UPDATE message.

This is identical to self.authority().

Returns the additional section.

Returns all four sections in one fell swoop.

Returns whether this is the answer to some other message.

The method checks whether the ID fields of the headers are the same, whether the QR flag is set in this message, and whether the questions are the same.

Returns the first question, if there is any.

The method will return None both if there are no questions or if parsing fails.

Returns the query type of the first question, if any.

Returns whether the message contains answers of a given type.

Resolves the canonical name of the answer.

Returns None if either the message doesn’t have a question or there was a parse error. Otherwise starts with the question’s name, follows any CNAME trail and returns the name answers should be for.

Trait Implementations

impl Clone for MessageBuf
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for MessageBuf
[src]

Formats the value using the given formatter. Read more

impl Deref for MessageBuf
[src]

The resulting type after dereferencing.

Dereferences the value.

impl DerefMut for MessageBuf
[src]

Mutably dereferences the value.

impl Borrow<Message> for MessageBuf
[src]

Immutably borrows from an owned value. Read more

impl AsRef<Message> for MessageBuf
[src]

Performs the conversion.

impl AsRef<[u8]> for MessageBuf
[src]

Performs the conversion.

impl AsMut<Message> for MessageBuf
[src]

Performs the conversion.

Auto Trait Implementations

impl Send for MessageBuf

impl Sync for MessageBuf