Trait ComposeRequest

Source
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§

Source

fn append_message<Target: Composer>( &self, target: Target, ) -> Result<AdditionalBuilder<Target>, CopyRecordsError>

Appends the final message to a provided composer.

Source

fn to_message(&self) -> Result<Message<Vec<u8>>, Error>

Create a message that captures the recorded changes.

Source

fn to_vec(&self) -> Result<Vec<u8>, Error>

Create a message that captures the recorded changes and convert to a Vec.

Source

fn header(&self) -> &Header

Return a reference to the current Header.

Source

fn header_mut(&mut self) -> &mut Header

Return a reference to a mutable Header to record changes to the header.

Source

fn set_udp_payload_size(&mut self, value: u16)

Set the UDP payload size.

Source

fn set_dnssec_ok(&mut self, value: bool)

Set the DNSSEC OK flag.

Source

fn add_opt(&mut self, opt: &impl ComposeOptData) -> Result<(), LongOptData>

Add an EDNS option.

Source

fn is_answer(&self, answer: &Message<[u8]>) -> bool

Returns whether a message is an answer to the request.

Source

fn dnssec_ok(&self) -> bool

Return the status of the DNSSEC OK flag.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§