Struct simple_dns::ResourceRecord
source · pub struct ResourceRecord<'a> {
pub name: Name<'a>,
pub class: CLASS,
pub ttl: u32,
pub rdata: RData<'a>,
pub cache_flush: bool,
}
Expand description
Resource Records are used to represent the answer, authority, and additional sections in DNS packets.
Fields§
§name: Name<'a>
A Name
to which this resource record pertains.
class: CLASS
A CLASS
that defines the class of the rdata field
ttl: u32
The time interval (in seconds) that the resource record may becached before it should be discarded.
Zero values are interpreted to mean that the RR can only be used for the transaction in progress, and should not be cached.
rdata: RData<'a>
A RData
with the contents of this resource record
cache_flush: bool
Indicates if this RR is a cache flush
Implementations§
source§impl<'a> ResourceRecord<'a>
impl<'a> ResourceRecord<'a>
sourcepub fn new(name: Name<'a>, class: CLASS, ttl: u32, rdata: RData<'a>) -> Self
pub fn new(name: Name<'a>, class: CLASS, ttl: u32, rdata: RData<'a>) -> Self
Creates a new ResourceRecord
sourcepub fn with_cache_flush(self, cache_flush: bool) -> Self
pub fn with_cache_flush(self, cache_flush: bool) -> Self
Consume self and change the cache_flush bit
sourcepub fn to_cache_flush_record(&self) -> Self
pub fn to_cache_flush_record(&self) -> Self
Returns a cloned self with cache_flush = true
sourcepub fn match_qclass(&self, qclass: QCLASS) -> bool
pub fn match_qclass(&self, qclass: QCLASS) -> bool
Return true if current resource match given query class
sourcepub fn match_qtype(&self, qtype: QTYPE) -> bool
pub fn match_qtype(&self, qtype: QTYPE) -> bool
Return true if current resource match given query type
sourcepub fn into_owned<'b>(self) -> ResourceRecord<'b>
pub fn into_owned<'b>(self) -> ResourceRecord<'b>
Transforms the inner data into its owned type
Trait Implementations§
source§impl<'a> Clone for ResourceRecord<'a>
impl<'a> Clone for ResourceRecord<'a>
source§fn clone(&self) -> ResourceRecord<'a>
fn clone(&self) -> ResourceRecord<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<'a> Debug for ResourceRecord<'a>
impl<'a> Debug for ResourceRecord<'a>
source§impl<'a> Hash for ResourceRecord<'a>
impl<'a> Hash for ResourceRecord<'a>
source§impl<'a> PartialEq for ResourceRecord<'a>
impl<'a> PartialEq for ResourceRecord<'a>
impl<'a> Eq for ResourceRecord<'a>
Auto Trait Implementations§
impl<'a> Freeze for ResourceRecord<'a>
impl<'a> RefUnwindSafe for ResourceRecord<'a>
impl<'a> Send for ResourceRecord<'a>
impl<'a> Sync for ResourceRecord<'a>
impl<'a> Unpin for ResourceRecord<'a>
impl<'a> UnwindSafe for ResourceRecord<'a>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)