Struct trust_dns::rr::RecordSet
[−]
[src]
pub struct RecordSet { /* fields omitted */ }
Set of resource records associated to a name and type
Methods
impl RecordSet
[src]
fn new(name: &Name, record_type: RecordType, serial: u32) -> Self
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
fn with_ttl(name: Name, record_type: RecordType, ttl: u32) -> Self
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
fn from(record: Record) -> Self
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
fn get_name(&self) -> &Name
Return value
Label of the Resource Record Set
fn get_record_type(&self) -> RecordType
Return value
RecordType
of the Resource Record Set
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
fn get_dns_class(&self) -> DNSClass
Return value
DNSClass
of the RecordSet
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
fn get_ttl(&self) -> u32
Return value
TTL, time-to-live, of the Resource Record Set, this is the maximum length of time that an RecordSet should be cached.
fn get_records(&self, and_rrsigs: bool) -> Vec<&Record>
Return value
Slice of all records in the set
fn iter<'s>(&'s self) -> Iter<'s, Record>
Returns an iterator over the records in the set
fn is_empty(&self) -> bool
Return value
True if there are no records in this set
fn get_serial(&self) -> u32
Return value
The serial number at which the record was updated.
fn get_rrsigs(&self) -> &[Record]
fn insert_rrsig(&mut self, rrsig: Record)
fn clear_rrsigs(&mut self)
fn new_record(&mut self, rdata: RData) -> &Record
creates a new Record as part of this RecordSet, adding the associated RData
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.
FIXME: make a default add without serial number for basic usage
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.
Trait Implementations
impl Clone for RecordSet
[src]
fn clone(&self) -> RecordSet
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for RecordSet
[src]
impl PartialEq for RecordSet
[src]
fn eq(&self, __arg_0: &RecordSet) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &RecordSet) -> bool
This method tests for !=
.