pub struct MessageRequest {
pub metadata: Metadata,
pub queries: Queries,
pub answers: Vec<Record>,
pub authorities: Vec<Record>,
pub additionals: Vec<Record>,
pub signature: Option<Box<Record<TSIG>>>,
pub edns: Option<Edns>,
}Expand description
A Message which captures the data from an inbound request
Fields§
§metadata: MetadataMetadata from the message header
queries: QueriesQuery name and other query parameters
answers: Vec<Record>Records which directly answer the query
Records with describe other authoritative servers
May optionally carry the SOA record for the authoritative data in the answer section.
additionals: Vec<Record>Records which may be helpful in using the records in the other sections
signature: Option<Box<Record<TSIG>>>TSIG signature for the message, if any
edns: Option<Edns>RFC 6891, EDNS(0) Extensions, April 2013
6.1.1. Basic Elements
An OPT pseudo-RR (sometimes called a meta-RR) MAY be added to the
additional data section of a request.
The OPT RR has RR type 41.
If an OPT record is present in a received request, compliant
responders MUST include an OPT record in their respective responses.
An OPT record does not carry any DNS data. It is used only to
contain control information pertaining to the question-and-answer
sequence of a specific transaction. OPT RRs MUST NOT be cached,
forwarded, or stored in or loaded from Zone Files.
The OPT RR MAY be placed anywhere within the additional data section.
When an OPT RR is included within any DNS message, it MUST be the
only OPT RR in that message. If a query message with more than one
OPT RR is received, a FORMERR (RCODE=1) MUST be returned. The
placement flexibility for the OPT RR does not override the need for
the TSIG or SIG(0) RRs to be the last in the additional section
whenever they are present.§Return value
Optionally returns a reference to EDNS OPT pseudo-RR
Implementations§
Source§impl MessageRequest
impl MessageRequest
Sourcepub fn mock(metadata: Metadata, query: impl Into<LowerQuery>) -> Self
Available on crate features testing only.
pub fn mock(metadata: Metadata, query: impl Into<LowerQuery>) -> Self
testing only.Construct a mock MessageRequest for testing purposes
The unspecified fields are left empty.
Sourcepub fn max_payload(&self) -> u16
pub fn max_payload(&self) -> u16
§Return value
the max payload value as it’s defined in the EDNS OPT pseudo-RR.
Trait Implementations§
Source§impl BinEncodable for MessageRequest
impl BinEncodable for MessageRequest
Source§fn emit(&self, encoder: &mut BinEncoder<'_>) -> Result<(), ProtoError>
fn emit(&self, encoder: &mut BinEncoder<'_>) -> Result<(), ProtoError>
Write the type to the stream
Source§impl Debug for MessageRequest
impl Debug for MessageRequest
Source§impl PartialEq for MessageRequest
impl PartialEq for MessageRequest
Source§impl UpdateRequest for MessageRequest
impl UpdateRequest for MessageRequest
Source§fn zone(&self) -> Result<&LowerQuery, LookupError>
fn zone(&self) -> Result<&LowerQuery, LookupError>
Zone being updated, this should be the query of a Message
Source§fn prerequisites(&self) -> &[Record]
fn prerequisites(&self) -> &[Record]
Prerequisites map to the Answer section of a Message
Source§fn additionals(&self) -> &[Record]
fn additionals(&self) -> &[Record]
Additional records
impl StructuralPartialEq for MessageRequest
Auto Trait Implementations§
impl Freeze for MessageRequest
impl RefUnwindSafe for MessageRequest
impl Send for MessageRequest
impl Sync for MessageRequest
impl Unpin for MessageRequest
impl UnsafeUnpin for MessageRequest
impl UnwindSafe for MessageRequest
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more