Struct trust_dns_client::op::Query
source · [−]pub struct Query { /* private fields */ }
Expand description
Query struct for looking up resource records, basically a resource record without RDATA.
RFC 1035, DOMAIN NAMES - IMPLEMENTATION AND SPECIFICATION, November 1987
4.1.2. Question section format
The question section is used to carry the "question" in most queries,
i.e., the parameters that define what is being asked. The section
contains QDCOUNT (usually 1) entries, each of the following format:
1 1 1 1 1 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| |
/ QNAME / ZNAME /
/ /
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| QTYPE / ZTYPE |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| QCLASS / ZCLASS |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
Implementations
sourceimpl Query
impl Query
sourcepub fn new() -> Query
pub fn new() -> Query
Return a default query with an empty name and A, IN for the query_type and query_class
sourcepub fn query(name: Name, query_type: RecordType) -> Query
pub fn query(name: Name, query_type: RecordType) -> Query
Create a new query from name and type, class defaults to IN
sourcepub fn set_query_type(&mut self, query_type: RecordType) -> &mut Query
pub fn set_query_type(&mut self, query_type: RecordType) -> &mut Query
Specify the RecordType being queried
sourcepub fn set_query_class(&mut self, query_class: DNSClass) -> &mut Query
pub fn set_query_class(&mut self, query_class: DNSClass) -> &mut Query
Specify÷ the DNS class of the Query, almost always IN
sourcepub fn set_mdns_unicast_response(&mut self, flag: bool) -> &mut Query
pub fn set_mdns_unicast_response(&mut self, flag: bool) -> &mut Query
Changes mDNS unicast-response bit See RFC 6762
sourcepub fn name(&self) -> &Name
pub fn name(&self) -> &Name
QNAME a domain name represented as a sequence of labels, where
each label consists of a length octet followed by that
number of octets. The domain name terminates with the
zero length octet for the null label of the root. Note
that this field may be an odd number of octets; no
padding is used.
sourcepub fn query_type(&self) -> RecordType
pub fn query_type(&self) -> RecordType
QTYPE a two octet code which specifies the type of the query.
The values for this field include all codes valid for a
TYPE field, together with some more general codes which
can match more than one type of RR.
sourcepub fn query_class(&self) -> DNSClass
pub fn query_class(&self) -> DNSClass
QCLASS a two octet code that specifies the class of the query.
For example, the QCLASS field is IN for the Internet.
sourcepub fn mdns_unicast_response(&self) -> bool
pub fn mdns_unicast_response(&self) -> bool
Returns if the mDNS unicast-response bit is set or not See RFC 6762
sourcepub fn into_parts(self) -> QueryParts
pub fn into_parts(self) -> QueryParts
Consumes Query
and returns it’s components
Trait Implementations
sourceimpl<'r> BinDecodable<'r> for Query
impl<'r> BinDecodable<'r> for Query
sourcepub fn read(decoder: &mut BinDecoder<'r>) -> Result<Query, ProtoError>
pub fn read(decoder: &mut BinDecoder<'r>) -> Result<Query, ProtoError>
Read the type from the stream
sourcefn from_bytes(bytes: &'r [u8]) -> Result<Self, ProtoError>
fn from_bytes(bytes: &'r [u8]) -> Result<Self, ProtoError>
Returns the object in binary form
sourceimpl BinEncodable for Query
impl BinEncodable for Query
sourcepub fn emit(&self, encoder: &mut BinEncoder<'_>) -> Result<(), ProtoError>
pub fn emit(&self, encoder: &mut BinEncoder<'_>) -> Result<(), ProtoError>
Write the type to the stream
sourceimpl From<Query> for LowerQuery
impl From<Query> for LowerQuery
sourcefn from(query: Query) -> LowerQuery
fn from(query: Query) -> LowerQuery
Performs the conversion.
impl Eq for Query
impl StructuralEq for Query
impl StructuralPartialEq for Query
Auto Trait Implementations
impl RefUnwindSafe for Query
impl Send for Query
impl Sync for Query
impl Unpin for Query
impl UnwindSafe for Query
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcepub fn equivalent(&self, key: &K) -> bool
pub fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
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>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub 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