pub struct Lookup { /* private fields */ }Expand description
Result of a DNS query when querying for any record type supported by the Hickory DNS Proto library.
For IP resolution see LookupIp, as it has more features for A and AAAA lookups.
Implementations§
Source§impl Lookup
impl Lookup
Sourcepub fn from_rdata(query: Query, rdata: RData) -> Lookup
pub fn from_rdata(query: Query, rdata: RData) -> Lookup
Return new instance with given rdata and the maximum TTL.
Sourcepub fn new_with_max_ttl(query: Query, records: Arc<[Record]>) -> Lookup
pub fn new_with_max_ttl(query: Query, records: Arc<[Record]>) -> Lookup
Return new instance with given records and the maximum TTL.
Sourcepub fn new_with_deadline(
query: Query,
records: Arc<[Record]>,
valid_until: Instant,
) -> Lookup
pub fn new_with_deadline( query: Query, records: Arc<[Record]>, valid_until: Instant, ) -> Lookup
Return a new instance with the given records and deadline.
Sourcepub fn query(&self) -> &Query
pub fn query(&self) -> &Query
Returns a reference to the Query that was used to produce this result.
Sourcepub fn iter(&self) -> LookupIter<'_> ⓘ
pub fn iter(&self) -> LookupIter<'_> ⓘ
Returns an iterator over the data of all records returned during the query.
It may include additional record types beyond the queried type, e.g. CNAME.
Sourcepub fn record_iter(&self) -> LookupRecordIter<'_> ⓘ
pub fn record_iter(&self) -> LookupRecordIter<'_> ⓘ
Returns an iterator over all records returned during the query.
It may include additional record types beyond the queried type, e.g. CNAME.
Sourcepub fn valid_until(&self) -> Instant
pub fn valid_until(&self) -> Instant
Returns the Instant at which this Lookup is no longer valid.
Sourcepub fn records(&self) -> &[Record]
pub fn records(&self) -> &[Record]
Returns an slice over all records that were returned during the query, this can include additional record types beyond the queried type, e.g. CNAME.
Sourcepub fn extend_records(&mut self, other: Vec<Record>)
pub fn extend_records(&mut self, other: Vec<Record>)
Add new records to this lookup, without creating a new Lookup