Struct DnsRequest
pub struct DnsRequest { /* private fields */ }Expand description
A DNS request object
This wraps a DNS Message for requests. It also has request options associated for controlling certain features of the DNS protocol handlers.
Implementations§
§impl DnsRequest
impl DnsRequest
pub fn from_query(query: Query, options: DnsRequestOptions) -> DnsRequest
pub fn from_query(query: Query, options: DnsRequestOptions) -> DnsRequest
Build a new DnsRequest from a Query and DnsRequestOptions.
pub fn new(message: Message, options: DnsRequestOptions) -> DnsRequest
pub fn new(message: Message, options: DnsRequestOptions) -> DnsRequest
Returns a new DnsRequest object
pub fn with_original_query(self, original_query: Option<Query>) -> DnsRequest
pub fn with_original_query(self, original_query: Option<Query>) -> DnsRequest
Add the original query
pub fn options(&self) -> &DnsRequestOptions
pub fn options(&self) -> &DnsRequestOptions
Get the set of request options associated with this request
pub fn options_mut(&mut self) -> &mut DnsRequestOptions
pub fn options_mut(&mut self) -> &mut DnsRequestOptions
Get a mutable reference to the request options associated with this request
pub fn into_parts(self) -> (Message, DnsRequestOptions)
pub fn into_parts(self) -> (Message, DnsRequestOptions)
Unwraps the raw message
pub fn original_query(&self) -> Option<&Query>
pub fn original_query(&self) -> Option<&Query>
Get the request’s original query
Methods from Deref<Target = Message>§
pub fn truncate(&self) -> Message
pub fn truncate(&self) -> Message
Truncates a Message, this blindly removes all response fields and sets truncated to true
pub fn add_query(&mut self, query: Query) -> &mut Message
pub fn add_query(&mut self, query: Query) -> &mut Message
Add a query to the Message, either the query response from the server, or the request Query.
pub fn add_queries<Q, I>(&mut self, queries: Q) -> &mut Message
pub fn add_queries<Q, I>(&mut self, queries: Q) -> &mut Message
Adds an iterator over a set of Queries to be added to the message
pub fn add_answer(&mut self, record: Record) -> &mut Message
pub fn add_answer(&mut self, record: Record) -> &mut Message
Add a record to the Answer section.
pub fn add_answers<R, I>(&mut self, records: R) -> &mut Message
pub fn add_answers<R, I>(&mut self, records: R) -> &mut Message
Add all the records from the iterator to the Answer section of the message.
pub fn insert_answers(&mut self, records: Vec<Record>)
pub fn insert_answers(&mut self, records: Vec<Record>)
Sets the Answer section to the specified set of records.
§Panics
Will panic if the Answer section is already non-empty.
Add a record to the Authority section.
Add all the records from the Iterator to the Authority section of the message.
Sets the Authority section to the specified set of records.
§Panics
Will panic if the Authority section is already non-empty.
pub fn add_additional(&mut self, record: Record) -> &mut Message
pub fn add_additional(&mut self, record: Record) -> &mut Message
Add a record to the Additional section.
pub fn add_additionals<R, I>(&mut self, records: R) -> &mut Message
pub fn add_additionals<R, I>(&mut self, records: R) -> &mut Message
Add all the records from the iterator to the Additional section of the message.
pub fn insert_additionals(&mut self, records: Vec<Record>)
pub fn insert_additionals(&mut self, records: Vec<Record>)
Sets the Additional to the specified set of records.
§Panics
Will panic if additional records are already associated to the message.
pub fn take_all_sections(&mut self) -> impl Iterator<Item = Record>
pub fn take_all_sections(&mut self) -> impl Iterator<Item = Record>
Consume the message, returning an iterator over records from all sections
pub fn all_sections(&self) -> impl Iterator<Item = &Record>
pub fn all_sections(&self) -> impl Iterator<Item = &Record>
All sections chained
pub 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.
pub fn signature(&self) -> Option<&Record<TSIG>>
pub fn signature(&self) -> Option<&Record<TSIG>>
§Return value
the signature over the message, if any
pub fn take_signature(&mut self) -> Option<Box<Record<TSIG>>>
pub fn take_signature(&mut self) -> Option<Box<Record<TSIG>>>
Remove signatures from the Message
pub fn to_vec(&self) -> Result<Vec<u8>, ProtoError>
pub fn to_vec(&self) -> Result<Vec<u8>, ProtoError>
Encodes the Message into a buffer
Trait Implementations§
§impl Clone for DnsRequest
impl Clone for DnsRequest
§fn clone(&self) -> DnsRequest
fn clone(&self) -> DnsRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Deref for DnsRequest
impl Deref for DnsRequest
§impl DerefMut for DnsRequest
impl DerefMut for DnsRequest
§fn deref_mut(&mut self) -> &mut <DnsRequest as Deref>::Target
fn deref_mut(&mut self) -> &mut <DnsRequest as Deref>::Target
§impl From<Message> for DnsRequest
impl From<Message> for DnsRequest
§fn from(message: Message) -> DnsRequest
fn from(message: Message) -> DnsRequest
§impl PartialEq for DnsRequest
impl PartialEq for DnsRequest
impl Eq for DnsRequest
impl StructuralPartialEq for DnsRequest
Auto Trait Implementations§
impl Freeze for DnsRequest
impl RefUnwindSafe for DnsRequest
impl Send for DnsRequest
impl Sync for DnsRequest
impl Unpin for DnsRequest
impl UnsafeUnpin for DnsRequest
impl UnwindSafe for DnsRequest
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
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
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<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