Struct MessageRequest

Source
pub struct MessageRequest { /* private fields */ }
Expand description

A Message which captures the data from an inbound request

Implementations§

Source§

impl 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 queries(&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<'q> BinDecodable<'q> for MessageRequest

Source§

fn read(decoder: &mut BinDecoder<'q>) -> Result<Self, ProtoError>

Reads a MessageRequest from the decoder

Source§

fn from_bytes(bytes: &'r [u8]) -> Result<Self, ProtoError>

Returns the object in binary form
Source§

impl BinEncodable for MessageRequest

Source§

fn emit(&self, encoder: &mut BinEncoder<'_>) -> Result<(), ProtoError>

Write the type to the stream
Source§

fn to_bytes(&self) -> Result<Vec<u8>, ProtoError>

Returns the object in binary form
Source§

impl Debug for MessageRequest

Source§

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

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

impl PartialEq for MessageRequest

Source§

fn eq(&self, other: &MessageRequest) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl UpdateRequest for MessageRequest

Source§

fn id(&self) -> u16

Id of the Message
Source§

fn zone(&self) -> Result<&LowerQuery, ProtoError>

Zone being updated, this should be the query of a Message
Source§

fn prerequisites(&self) -> &[Record]

Prerequisites map to the answers of a Message
Source§

fn updates(&self) -> &[Record]

Records to update map to the name_servers of a Message
Source§

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

Additional records
Source§

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

SIG0 records for verifying the Message
Source§

impl StructuralPartialEq for MessageRequest

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

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>,

Source§

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

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

Source§

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

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T