Struct domain::bits::message_builder::AnswerBuilder
[−]
[src]
pub struct AnswerBuilder { /* fields omitted */ }
A type for building the answer section of a DNS message.
This type is typically constructed by calling answer()
on a
MessageBuilder
. See the module documentation for details.
Methods
impl AnswerBuilder
[src]
pub fn header(&self) -> &Header
[src]
Returns a reference to the messages header.
pub fn header_mut(&mut self) -> &mut Header
[src]
Returns a mutable reference to the messages header.
pub fn push<N, D, R>(&mut self, record: R) -> ComposeResult<()> where
N: DName,
D: RecordData,
R: Into<Record<N, D>>,
[src]
N: DName,
D: RecordData,
R: Into<Record<N, D>>,
Appends a new resource record to the answer section.
This method is generic over anything that can be converted into a
Record
. In particular, you can use four-tuples consisting of
a domain name, class, TTL, and record data or triples leaving out
the class which will then be assumed to be Class::In
.
pub fn rewind(&mut self)
[src]
Rewinds to the beginning of the answer section.
This drops all previously assembled answer records.
[src]
Proceeds to building the authority section.
pub fn additional(self) -> AdditionalBuilder
[src]
Proceeds to building the additional section, skipping authority.
pub fn preview(&mut self) -> &[u8]
[src]
Returns a reference to the message assembled so far.
This method requires a &mut self
since it may need to update some
length values to return a valid message.
In case the builder was created from a vector with previous content, the returned reference is for the full content of this vector.
pub fn finish(self) -> Vec<u8>
[src]
Finishes the message.
The resulting message will have empty authority and additional sections.
Trait Implementations
impl Clone for AnswerBuilder
[src]
fn clone(&self) -> AnswerBuilder
[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