Package dns :: Module rrset :: Class RRset
[hide private]
[frames] | no frames]

Class RRset

source code

   object --+        
            |        
      set.Set --+    
                |    
rdataset.Rdataset --+
                    |
                   RRset

A DNS RRset (named rdataset).

RRset inherits from Rdataset, and RRsets can be treated as Rdatasets in most cases. There are, however, a few notable exceptions. RRsets have different to_wire() and to_text() method arguments, reflecting the fact that RRsets always have an owner name.

Instance Methods [hide private]
 
__init__(self, name, rdclass, rdtype, covers=0, deleting=None)
Create a new RRset.
source code
 
_clone(self)
Make a (shallow) copy of the set.
source code
 
__repr__(self)
repr(x)
source code
 
__str__(self)
str(x)
source code
 
__eq__(self, other) source code
 
match(self, name, rdclass, rdtype, covers, deleting=None)
Returns ``True`` if this rrset matches the specified class, type, covers, and deletion state.
source code
 
to_text(self, origin=None, relativize=True, **kw)
Convert the RRset into DNS master file format.
source code
 
to_wire(self, file, compress=None, origin=None, **kw)
Convert the RRset to wire format.
source code
 
to_rdataset(self)
Convert an RRset into an Rdataset.
source code

Inherited from rdataset.Rdataset: __ne__, add, intersection_update, union_update, update, update_ttl

Inherited from set.Set: __add__, __and__, __copy__, __delitem__, __getitem__, __iadd__, __iand__, __ior__, __isub__, __iter__, __len__, __or__, __sub__, clear, copy, difference, difference_update, discard, intersection, issubset, issuperset, remove, union

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Properties [hide private]
  deleting
  name

Inherited from rdataset.Rdataset: covers, rdclass, rdtype, ttl

Inherited from set.Set: items

Inherited from object: __class__

Method Details [hide private]

__init__(self, name, rdclass, rdtype, covers=0, deleting=None)
(Constructor)

source code 

Create a new RRset.

Overrides: object.__init__

_clone(self)

source code 

Make a (shallow) copy of the set.

There is a 'clone protocol' that subclasses of this class should use. To make a copy, first call your super's _clone() method, and use the object returned as the new instance. Then make shallow copies of the attributes defined in the subclass.

This protocol allows us to write the set algorithms that return new instances (e.g. union) once, and keep using them in subclasses.

Overrides: set.Set._clone
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

__eq__(self, other)
(Equality operator)

source code 
Overrides: set.Set.__eq__

match(self, name, rdclass, rdtype, covers, deleting=None)

source code 

Returns ``True`` if this rrset matches the specified class, type, covers, and deletion state.

Overrides: rdataset.Rdataset.match

to_text(self, origin=None, relativize=True, **kw)

source code 

Convert the RRset into DNS master file format.

See ``dns.name.Name.choose_relativity`` for more information on how *origin* and *relativize* determine the way names are emitted.

Any additional keyword arguments are passed on to the rdata ``to_text()`` method.

*origin*, a ``dns.name.Name`` or ``None``, the origin for relative names.

*relativize*, a ``bool``. If ``True``, names will be relativized to *origin*.

Overrides: rdataset.Rdataset.to_text

to_wire(self, file, compress=None, origin=None, **kw)

source code 

Convert the RRset to wire format.

All keyword arguments are passed to ``dns.rdataset.to_wire()``; see that function for details.

Returns an ``int``, the number of records emitted.

Overrides: rdataset.Rdataset.to_wire

to_rdataset(self)

source code 

Convert an RRset into an Rdataset.

Returns a ``dns.rdataset.Rdataset``.