pub struct RecordCache { /* private fields */ }Expand description
Cache of DNS resource records, keyed by “lowercase name, record type”.
Implementations§
Source§impl RecordCache
impl RecordCache
pub fn new() -> Self
Sourcepub fn ingest(&mut self, rr: &RR) -> bool
pub fn ingest(&mut self, rr: &RR) -> bool
Insert or update records from a DNS response. TTL=0 removes the specific record whose rdata matches (RFC 6762 10.1).
Sourcepub fn evict_expired(&mut self) -> Vec<(String, u16)>
pub fn evict_expired(&mut self) -> Vec<(String, u16)>
Remove expired entries. Returns list of (name, type) keys that were fully removed.
Sourcepub fn lookup(&self, name: &str, qtype: u16) -> Vec<RR>
pub fn lookup(&self, name: &str, qtype: u16) -> Vec<RR>
Lookup non-expired records by exact (lowercase name, type).
Sourcepub fn lookup_name(&self, name: &str) -> Vec<RR>
pub fn lookup_name(&self, name: &str) -> Vec<RR>
Lookup all non-expired records matching a name (any type).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RecordCache
impl RefUnwindSafe for RecordCache
impl Send for RecordCache
impl Sync for RecordCache
impl Unpin for RecordCache
impl UnwindSafe for RecordCache
Blanket Implementations§
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
Mutably borrows from an owned value. Read more