pub struct Request { /* private fields */ }
Expand description

An incoming request to the DNS catalog

Implementations§

source§

impl Request

source

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.

source

pub fn request_info(&self) -> RequestInfo<'_>

Return just the header and request information from the Request Message

source

pub fn src(&self) -> SocketAddr

The IP address from which the request originated.

source

pub fn protocol(&self) -> Protocol

The protocol that was used for the request

Methods from Deref<Target = MessageRequest>§

source

pub fn header(&self) -> &Header

Return the request header

source

pub fn id(&self) -> u16

see Header::id()

source

pub fn message_type(&self) -> MessageType

see Header::message_type()

source

pub fn op_code(&self) -> OpCode

see Header::op_code()

source

pub fn authoritative(&self) -> bool

see Header::authoritative()

source

pub fn truncated(&self) -> bool

see Header::truncated()

source

pub fn recursion_desired(&self) -> bool

see Header::recursion_desired()

source

pub fn recursion_available(&self) -> bool

see Header::recursion_available()

source

pub fn authentic_data(&self) -> bool

see Header::authentic_data()

source

pub fn checking_disabled(&self) -> bool

see Header::checking_disabled()

source

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

source

pub fn query(&self) -> &LowerQuery

Question        Carries the query name and other query parameters.
source

pub fn answers(&self) -> &[Record]

Answer          Carries RRs which directly answer the query.
source

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.
source

pub fn additionals(&self) -> &[Record]

Additional      Carries RRs which may be helpful in using the RRs in the
                other sections.
source

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.

source

pub fn sig0(&self) -> &[Record]

Any SIG0 records for signed messages

source

pub fn max_payload(&self) -> u16

Return value

the max payload value as it’s defined in the EDNS section.

source

pub fn version(&self) -> u8

Return value

the version as defined in the EDNS record

Trait Implementations§

source§

impl Debug for Request

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Deref for Request

§

type Target = MessageRequest

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more