Struct RecordSet
pub struct RecordSet { /* private fields */ }
Expand description
Set of resource records associated to a name and type
Implementations§
§impl RecordSet
impl RecordSet
pub fn new(name: Name, record_type: RecordType, serial: u32) -> RecordSet
pub fn new(name: Name, record_type: RecordType, serial: u32) -> RecordSet
Creates a new Resource Record Set.
§Arguments
name
- The label for theRecordSet
record_type
-RecordType
of thisRecordSet
, all records in theRecordSet
must be of the specifiedRecordType
.serial
- current serial number of theSOA
record, this is to be used forIXFR
and signing for DNSSEC after updates.
§Return value
The newly created Resource Record Set TODO: make all cloned params pass by value
pub fn with_ttl(name: Name, record_type: RecordType, ttl: u32) -> RecordSet
pub fn with_ttl(name: Name, record_type: RecordType, ttl: u32) -> RecordSet
Creates a new Resource Record Set.
§Arguments
name
- The label for theRecordSet
record_type
-RecordType
of thisRecordSet
, all records in theRecordSet
must be of the specifiedRecordType
.ttl
- time-to-live for theRecordSet
in seconds.
§Return value
The newly created Resource Record Set TODO: make all cloned params pass by value
pub fn record_type(&self) -> RecordType
pub fn record_type(&self) -> RecordType
§Return value
RecordType
of the Resource Record Set
pub fn set_dns_class(&mut self, dns_class: DNSClass)
pub fn set_dns_class(&mut self, dns_class: DNSClass)
Sets the DNSClass to the specified value
This will traverse every record and associate with it the specified dns_class
pub fn set_ttl(&mut self, ttl: u32)
pub fn set_ttl(&mut self, ttl: u32)
Sets the TTL, in seconds, to the specified value
This will traverse every record and associate with it the specified ttl
pub fn ttl(&self) -> u32
pub fn ttl(&self) -> u32
Returns the time-to-live for the record.
§Return value
TTL, time-to-live, of the Resource Record Set, this is the maximum length of time that an RecordSet should be cached.
pub fn records_without_rrsigs(&self) -> RrsetRecords<'_> ⓘ
pub fn records_without_rrsigs(&self) -> RrsetRecords<'_> ⓘ
Returns a Vec of all records in the set, without any RRSIGs.
pub fn iter(&self) -> Iter<'_, Record> ⓘ
👎Deprecated: see records_without_rrsigs
pub fn iter(&self) -> Iter<'_, Record> ⓘ
records_without_rrsigs
Returns an iterator over the records in the set
pub fn insert_rrsig(&mut self, rrsig: Record)
pub fn insert_rrsig(&mut self, rrsig: Record)
Inserts a Signature for the Record set
Many can be associated with the RecordSet. Once added, the RecordSet should not be changed
§Arguments
rrsig
- A signature which covers the RecordSet.
pub fn clear_rrsigs(&mut self)
pub fn clear_rrsigs(&mut self)
Useful for clearing all signatures when the RecordSet is updated, or keys are rotated.
pub fn new_record(&mut self, rdata: &RData) -> &Record
pub fn new_record(&mut self, rdata: &RData) -> &Record
creates a new Record as part of this RecordSet, adding the associated RData
this interface may be deprecated in the future.
pub fn add_rdata(&mut self, rdata: RData) -> bool
pub fn add_rdata(&mut self, rdata: RData) -> bool
creates a new Record as part of this RecordSet, adding the associated RData
pub fn insert(&mut self, record: Record, serial: u32) -> bool
pub fn insert(&mut self, record: Record, serial: u32) -> bool
Inserts a new Resource Record into the Set.
If the record is inserted, the ttl for the most recent record will be used for the ttl of the entire resource record set.
This abides by the following restrictions in RFC 2136, April 1997:
1.1.5. The following RR types cannot be appended to an RRset. If the
following comparison rules are met, then an attempt to add the new RR
will result in the replacement of the previous RR:
SOA compare only NAME, CLASS and TYPE -- it is not possible to
have more than one SOA per zone, even if any of the data
fields differ.
CNAME compare only NAME, CLASS, and TYPE -- it is not possible
to have more than one CNAME RR, even if their data fields
differ.
§Arguments
record
-Record
asserts that thename
andrecord_type
match theRecordSet
.serial
- current serial number of theSOA
record, this is to be used forIXFR
and signing for DNSSEC after updates. The serial will only be updated if the record was added.
§Return value
True if the record was inserted.
TODO: make a default add without serial number for basic usage
pub fn remove(&mut self, record: &Record, serial: u32) -> bool
pub fn remove(&mut self, record: &Record, serial: u32) -> bool
Removes the Resource Record if it exists.
§Arguments
record
-Record
asserts that thename
andrecord_type
match theRecordSet
. Removes anyrecord
if the record data,RData
, match.serial
- current serial number of theSOA
record, this is to be used forIXFR
and signing for DNSSEC after updates. The serial will only be updated if the record was added.
§Return value
True if a record was removed.
pub fn into_parts(self) -> RecordSetParts
pub fn into_parts(self) -> RecordSetParts
Consumes RecordSet
and returns its components
Trait Implementations§
§impl IntoIterator for RecordSet
impl IntoIterator for RecordSet
§impl IntoRecordSet for RecordSet
impl IntoRecordSet for RecordSet
§fn into_record_set(self) -> RecordSet
fn into_record_set(self) -> RecordSet
impl Eq for RecordSet
impl StructuralPartialEq for RecordSet
Auto Trait Implementations§
impl Freeze for RecordSet
impl RefUnwindSafe for RecordSet
impl Send for RecordSet
impl Sync for RecordSet
impl Unpin for RecordSet
impl UnwindSafe for RecordSet
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<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> 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