pub fn add(
        &mut self,
        owner: &Name,
        rr_type: Type,
        class: Class,
        ttl: Ttl,
        rdata: &Rdata,
    ) -> Result<(), Error> {
        // NOTE: RrsetList::add will perform the TTL check. While it
        // will also check the CLASS against existing records in the
        // list, we need to check that that is this zone's CLASS.
        if !owner.eq_or_subdomain_of(self.name()) {
            return Err(Error::NotInZone);
        }
        if class != self.class {
            return Err(Error::ClassMismatch);
        }
        let node = self
            .apex
            .get_or_create_descendant(owner, owner.len() - self.apex.name.len());
        node.rrsets
            .add(rr_type, class, ttl, rdata)
            .map_err(|e| e.into())
    }
/// Adds a record to the `Zone`.
///
/// This is designed with the "zone file" paradigm in mind: records
/// are added in a "flat" manner, one by one. The implementation
/// then takes care of maintaining consistency (see the failure
/// conditions below) and organizing records into RRsets, which are
/// then attached to `Node`s mirroring the conceptual DNS tree.
///
/// This will fail if the provided owner is not within the zone, if
/// the record's class does not match the zone, or if the record's
/// TTL does not match other records in its RRset. (These are
/// checks 1, 10, and 11, described in the `validation` module.)
///
/// **Warning:** this is currently *not* guaranteed to be an atomic
/// operation, as it is expected that caller will abort the zone
/// load if an error occurs. This will need to change to support
/// dynamic updates (RFC 2136), but for now, *do not* continue to
/// use the `Zone` if this fails: it may be in an inconsistent
/// state.
Adds a record to the `Zone`.
This is designed with the "zone file" paradigm in mind: records
are added in a "flat" manner, one by one. The implementation
then takes care of maintaining consistency (see the failure
conditions below) and organizing records into RRsets, which are
then attached to `Node`s mirroring the conceptual DNS tree.

This will fail if the provided owner is not within the zone, if
the record's class does not match the zone, or if the record's
TTL does not match other records in its RRset. (These are
checks 1, 10, and 11, described in the `validation` module.)

this is currently *not* guaranteed to be an atomic
operation, as it is expected that caller will abort the zone
load if an error occurs. This will need to change to support
dynamic updates (RFC 2136), but for now, *do not* continue to
use the `Zone` if this fails: it may be in an inconsistent
state.
Adds a record to the ` Zone ` . This is designed with the " zone file " paradigm in mind : records are added in a " flat " manner one by one . The implementation then takes care of maintaining consistency ( see the failure conditions below ) and organizing records into RRsets which are then attached to ` Node ` s mirroring the conceptual DNS tree . This will fail if the provided owner is not within the zone if the record ' s class does not match the zone or if the record ' s TTL does not match other records in its RRset . ( These are checks 1 10 and 11 described in the ` validation ` module . ) this is currently * not * guaranteed to be an atomic operation as it is expected that caller will abort the zone load if an error occurs . This will need to change to support dynamic updates ( RFC 2136 ) but for now * do not * continue to use the ` Zone ` if this fails : it may be in an inconsistent state .
pub fn add(
        &mut self,
        owner: &Name,
        rr_type: Type,
        class: Class,
        ttl: Ttl,
        rdata: &Rdata,
    ) -> Result<(), Error> {
        // NOTE: RrsetList::add will perform the TTL check. While it
        // will also check the CLASS against existing records in the
        // list, we need to check that that is this zone's CLASS.
        if !owner.eq_or_subdomain_of(self.name()) {
            return Err(Error::NotInZone);
        }
        if class != self.class {
            return Err(Error::ClassMismatch);
        }
        let node = self
            .apex
            .get_or_create_descendant(owner, owner.len() - self.apex.name.len());
        node.rrsets
            .add(rr_type, class, ttl, rdata)
            .map_err(|e| e.into())
    }
pub fn add ( & mut self , owner : & Name , rr_type : Type , class : Class , ttl : Ttl , rdata : & Rdata , ) -> Result < ( ) , Error > { // NOTE: RrsetList::add will perform the TTL check. While it // will also check the CLASS against existing records in the // list, we need to check that that is this zone's CLASS. if ! owner . eq_or_subdomain_of ( self . name ( ) ) { return Err ( Error :: NotInZone ) ; } if class != self . class { return Err ( Error :: ClassMismatch ) ; } let node = self . apex . get_or_create_descendant ( owner , owner . len ( ) - self . apex . name . len ( ) ) ; node . rrsets . add ( rr_type , class , ttl , rdata ) . map_err ( | e | e . into ( ) ) }
Adds a record to the `Zone`.
Adds a record to the ` Zone ` .
&mut self
owner
&Name
rr_type
Type
class
Class
ttl
Ttl
rdata
&Rdata
&mut self
owner
&Name
rr_type
Type
class
Class
ttl
Ttl
rdata
&Rdata