Struct MessageHeader
pub struct MessageHeader { /* private fields */ }dns and std only.Expand description
The fixed twelve-octet header of a DNS message.
RFC 1035 Section 4.1.1 defines the identifier, the flag word, and the four section counts. The counts describe the message as sent; they are not a promise that every counted record is present or well formed.
Implementations§
§impl MessageHeader
impl MessageHeader
pub fn parse(message: &[u8]) -> Result<MessageHeader, MessageParseError>
pub fn parse(message: &[u8]) -> Result<MessageHeader, MessageParseError>
Parse the fixed header at the start of a DNS message.
Octets beyond the header are ignored, so this also inspects a message whose sections are unparsed, truncated, or not yet received.
pub const fn is_response(&self) -> bool
pub const fn is_response(&self) -> bool
Return whether the QR bit marks this message as a response.
Return whether the answering server is authoritative for the name.
pub const fn is_truncated(&self) -> bool
pub const fn is_truncated(&self) -> bool
Return whether the message was truncated by its transport.
pub const fn is_recursion_desired(&self) -> bool
pub const fn is_recursion_desired(&self) -> bool
Return whether the query asked the server to recurse.
pub const fn is_recursion_available(&self) -> bool
pub const fn is_recursion_available(&self) -> bool
Return whether the server offers recursion.
pub const fn is_authentic_data(&self) -> bool
pub const fn is_authentic_data(&self) -> bool
Return the RFC 4035 authentic-data bit.
pub const fn is_checking_disabled(&self) -> bool
pub const fn is_checking_disabled(&self) -> bool
Return the RFC 4035 checking-disabled bit.
pub fn response_code(&self) -> ResponseCode
pub fn response_code(&self) -> ResponseCode
Return the response code held by the header’s low four bits.
EDNS(0) and TSIG extend this field with upper bits carried elsewhere in the message; those extensions are not read here.
pub const fn question_count(&self) -> u16
pub const fn question_count(&self) -> u16
Return the declared question count (QDCOUNT).
pub const fn answer_count(&self) -> u16
pub const fn answer_count(&self) -> u16
Return the declared answer count (ANCOUNT).
Return the declared authority count (NSCOUNT).
Message never parses that section; this reports what it skipped.
pub const fn additional_count(&self) -> u16
pub const fn additional_count(&self) -> u16
Return the declared additional count (ARCOUNT).
Message never parses that section; this reports what it skipped.
Trait Implementations§
§impl Clone for MessageHeader
impl Clone for MessageHeader
§fn clone(&self) -> MessageHeader
fn clone(&self) -> MessageHeader
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for MessageHeader
§impl Debug for MessageHeader
impl Debug for MessageHeader
impl Eq for MessageHeader
§impl Hash for MessageHeader
impl Hash for MessageHeader
§impl PartialEq for MessageHeader
impl PartialEq for MessageHeader
impl StructuralPartialEq for MessageHeader
Auto Trait Implementations§
impl Freeze for MessageHeader
impl RefUnwindSafe for MessageHeader
impl Send for MessageHeader
impl Sync for MessageHeader
impl Unpin for MessageHeader
impl UnsafeUnpin for MessageHeader
impl UnwindSafe for MessageHeader
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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> ⓘ
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> ⓘ
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more