domain::net::client::request

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.

Object Safety§

This trait is not object safe.

Implementors§