[−][src]Struct trust_dns_proto::rr::RecordSet
Set of resource records associated to a name and type
Methods
impl RecordSet
[src]
impl RecordSet
pub fn new(name: &Name, record_type: RecordType, serial: u32) -> Self | [src] |
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) -> Self | [src] |
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 from(record: Record) -> Self | [src] |
Creates a new Resource Record Set from a Record
Arguments
record
- initializes a record set with a single record
Return value
The newly created Resource Record Set
pub fn name(&self) -> &Name | [src] |
Return value
Label of the Resource Record Set
pub fn record_type(&self) -> RecordType | [src] |
Return value
RecordType
of the Resource Record Set
pub fn set_dns_class(&mut self, dns_class: DNSClass) | [src] |
Sets the DNSClass to the specified value
This will traverse every record and associate with it the specified dns_class
pub fn dns_class(&self) -> DNSClass | [src] |
Returns the DNSClass
of the RecordSet
pub fn set_ttl(&mut self, ttl: u32) | [src] |
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 | [src] |
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.
ⓘImportant traits for RrsetRecords<'r>
pub fn records_without_rrsigs<'s>(&'s self) -> RrsetRecords<'s> | [src] |
Returns a Vec of all records in the set, without any RRSIGs.
pub fn iter<'s>(&'s self) -> Iter<'s, Record> | [src] |
see records_without_rrsigs
Returns an iterator over the records in the set
pub fn is_empty(&self) -> bool | [src] |
Returns true if there are no records in this set
pub fn serial(&self) -> u32 | [src] |
Returns the serial number at which the record was updated.
pub fn rrsigs(&self) -> &[Record] | [src] |
Returns a slice of all the Records signatures in the RecordSet
pub fn insert_rrsig(&mut self, rrsig: Record) | [src] |
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) | [src] |
Useful for clearing all signatures when the RecordSet is updated, or keys are rotated.
pub fn new_record(&mut self, rdata: &RData) -> &Record | [src] |
creates a new Record as part of this RecordSet, adding the associated RData
pub fn insert(&mut self, record: Record, serial: u32) -> bool | [src] |
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 | [src] |
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.
Trait Implementations
impl IntoRecordSet for RecordSet
[src]
impl IntoRecordSet for RecordSet
fn into_record_set(self) -> Self | [src] |
impl Clone for RecordSet
[src]
impl Clone for RecordSet
fn clone(&self) -> RecordSet | [src] |
fn clone_from(&mut self, source: &Self) | 1.0.0 [src] |
Performs copy-assignment from source
. Read more
impl PartialEq<RecordSet> for RecordSet
[src]
impl PartialEq<RecordSet> for RecordSet
impl IntoIterator for RecordSet
[src]
impl IntoIterator for RecordSet
type Item = Record
The type of the elements being iterated over.
type IntoIter = Chain<IntoIter<Record>, IntoIter<Record>>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter | [src] |
impl Debug for RecordSet
[src]
impl Debug for RecordSet
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator,
[src]
impl<I> IntoIterator for I where
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I | [src] |
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> | [src] |
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId | [src] |
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T | [src] |
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<T> Erased for T
impl<T> Erased for T