Struct trust_dns_server::server::Request
source · [−]pub struct Request { /* private fields */ }
Expand description
An incoming request to the DNS catalog
Implementations
sourceimpl Request
impl Request
sourcepub fn new(message: MessageRequest, src: SocketAddr, protocol: Protocol) -> Self
pub fn new(message: MessageRequest, src: SocketAddr, protocol: Protocol) -> Self
Build a new requests with the inbound message, source address, and protocol.
This will return an error on bad verification.
sourcepub fn request_info(&self) -> RequestInfo<'_>
pub fn request_info(&self) -> RequestInfo<'_>
Return just the header and request information from the Request Message
sourcepub fn src(&self) -> SocketAddr
pub fn src(&self) -> SocketAddr
The IP address from which the request originated.
Methods from Deref<Target = MessageRequest>
sourcepub fn message_type(&self) -> MessageType
pub fn message_type(&self) -> MessageType
see Header::message_type()
see Header::authoritative()
sourcepub fn recursion_desired(&self) -> bool
pub fn recursion_desired(&self) -> bool
see Header::recursion_desired()
sourcepub fn recursion_available(&self) -> bool
pub fn recursion_available(&self) -> bool
see Header::recursion_available()
sourcepub fn authentic_data(&self) -> bool
pub fn authentic_data(&self) -> bool
see Header::authentic_data()
sourcepub fn checking_disabled(&self) -> bool
pub fn checking_disabled(&self) -> bool
see Header::checking_disabled()
sourcepub fn response_code(&self) -> ResponseCode
pub fn response_code(&self) -> ResponseCode
Return value
The ResponseCode
, if this is an EDNS message then this will join the section from the OPT
record to create the EDNS ResponseCode
sourcepub fn query(&self) -> &LowerQuery
pub fn query(&self) -> &LowerQuery
Question Carries the query name and other query parameters.
sourcepub fn name_servers(&self) -> &[Record]
pub fn name_servers(&self) -> &[Record]
Authority Carries RRs which describe other authoritative servers.
May optionally carry the SOA RR for the authoritative
data in the answer section.
sourcepub fn additionals(&self) -> &[Record]
pub fn additionals(&self) -> &[Record]
Additional Carries RRs which may be helpful in using the RRs in the
other sections.
sourcepub fn edns(&self) -> Option<&Edns>
pub fn edns(&self) -> 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
Returns the EDNS record if it was found in the additional section.
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 section.
sourcepub fn version(&self) -> u8
pub fn version(&self) -> u8
Return value
the version as defined in the EDNS record
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnwindSafe for Request
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more