pub struct AdditionalBuilder { /* private fields */ }
Expand description
Builds the additional section of a DNS message.
This type can be constructed by calling additional
on a
MessageBuilder
, AnswerBuilder
, or AuthorityBuilder
. See the
module documentation for on overview on building messages.
Once aquired, you can add records to the additional section via the
push
method. If the record you want to add is an OPT record, you
can also use the OptBuilder
type which you can acquire via the
opt
method.
Implementations§
Source§impl AdditionalBuilder
impl AdditionalBuilder
Sourcepub fn opt(self) -> Result<OptBuilder, ShortBuf>where
Self: Sized,
pub fn opt(self) -> Result<OptBuilder, ShortBuf>where
Self: Sized,
Proceeds to building the OPT record.
The method will start by adding the record header. Since this may
exceed the message limit, the method may fail.
If you have saved space for the OPT record via set_limit
earlier,
remember to increase the limit again before calling opt
.
Trait Implementations§
Source§impl Clone for AdditionalBuilder
impl Clone for AdditionalBuilder
Source§fn clone(&self) -> AdditionalBuilder
fn clone(&self) -> AdditionalBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for AdditionalBuilder
impl Debug for AdditionalBuilder
Source§impl SectionBuilder for AdditionalBuilder
impl SectionBuilder for AdditionalBuilder
Source§fn into_target(self) -> MessageTarget
fn into_target(self) -> MessageTarget
Converts into target
Source§fn get_target(&self) -> &MessageTarget
fn get_target(&self) -> &MessageTarget
Returns message target
Source§fn get_target_mut(&mut self) -> &mut MessageTarget
fn get_target_mut(&mut self) -> &mut MessageTarget
Returns message target
Source§fn header_mut(&mut self) -> &mut Header
fn header_mut(&mut self) -> &mut Header
Returns a mutable reference to the messages header.
Source§fn prelude(&self) -> &[u8] ⓘ
fn prelude(&self) -> &[u8] ⓘ
Returns a reference to the slice preceeding the message. Read more
Source§fn prelude_mut(&mut self) -> &mut [u8] ⓘ
fn prelude_mut(&mut self) -> &mut [u8] ⓘ
Returns a mutable reference to the slice preceeding the message.
Source§fn finish(self) -> BytesMut
fn finish(self) -> BytesMut
Finishes the message and returns the underlying bytes buffer. Read more
Source§fn freeze(self) -> Message
fn freeze(self) -> Message
Finishes the message and returns the resulting bytes value. Read more
Auto Trait Implementations§
impl !Freeze for AdditionalBuilder
impl RefUnwindSafe for AdditionalBuilder
impl Send for AdditionalBuilder
impl Sync for AdditionalBuilder
impl Unpin for AdditionalBuilder
impl UnwindSafe for AdditionalBuilder
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