pub trait ComposeRequest:
Debug
+ Send
+ Sync {
// Required methods
fn append_message<Target: Composer>(
&self,
target: Target,
) -> Result<AdditionalBuilder<Target>, CopyRecordsError>;
fn to_message(&self) -> Result<Message<Vec<u8>>, Error>;
fn to_vec(&self) -> Result<Vec<u8>, Error>;
fn header(&self) -> &Header;
fn header_mut(&mut self) -> &mut Header;
fn set_udp_payload_size(&mut self, value: u16);
fn set_dnssec_ok(&mut self, value: bool);
fn add_opt(&mut self, opt: &impl ComposeOptData) -> Result<(), LongOptData>;
fn is_answer(&self, answer: &Message<[u8]>) -> bool;
fn dnssec_ok(&self) -> bool;
}
Expand description
A trait that allows composing a request as a series.
Required Methods§
sourcefn append_message<Target: Composer>(
&self,
target: Target,
) -> Result<AdditionalBuilder<Target>, CopyRecordsError>
fn append_message<Target: Composer>( &self, target: Target, ) -> Result<AdditionalBuilder<Target>, CopyRecordsError>
Appends the final message to a provided composer.
sourcefn to_message(&self) -> Result<Message<Vec<u8>>, Error>
fn to_message(&self) -> Result<Message<Vec<u8>>, Error>
Create a message that captures the recorded changes.
sourcefn to_vec(&self) -> Result<Vec<u8>, Error>
fn to_vec(&self) -> Result<Vec<u8>, Error>
Create a message that captures the recorded changes and convert to a Vec.
sourcefn header_mut(&mut self) -> &mut Header
fn header_mut(&mut self) -> &mut Header
Return a reference to a mutable Header to record changes to the header.
sourcefn set_udp_payload_size(&mut self, value: u16)
fn set_udp_payload_size(&mut self, value: u16)
Set the UDP payload size.
sourcefn set_dnssec_ok(&mut self, value: bool)
fn set_dnssec_ok(&mut self, value: bool)
Set the DNSSEC OK flag.
sourcefn add_opt(&mut self, opt: &impl ComposeOptData) -> Result<(), LongOptData>
fn add_opt(&mut self, opt: &impl ComposeOptData) -> Result<(), LongOptData>
Add an EDNS option.
Object Safety§
This trait is not object safe.