rdataset.pyi 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. from typing import Optional, Dict, List, Union
  2. from io import BytesIO
  3. from . import exception, name, set, rdatatype, rdata, rdataset
  4. class DifferingCovers(exception.DNSException):
  5. """An attempt was made to add a DNS SIG/RRSIG whose covered type
  6. is not the same as that of the other rdatas in the rdataset."""
  7. class IncompatibleTypes(exception.DNSException):
  8. """An attempt was made to add DNS RR data of an incompatible type."""
  9. class Rdataset(set.Set):
  10. def __init__(self, rdclass, rdtype, covers=rdatatype.NONE, ttl=0):
  11. self.rdclass : int = rdclass
  12. self.rdtype : int = rdtype
  13. self.covers : int = covers
  14. self.ttl : int = ttl
  15. def update_ttl(self, ttl : int) -> None:
  16. ...
  17. def add(self, rd : rdata.Rdata, ttl : Optional[int] =None):
  18. ...
  19. def union_update(self, other : Rdataset):
  20. ...
  21. def intersection_update(self, other : Rdataset):
  22. ...
  23. def update(self, other : Rdataset):
  24. ...
  25. def to_text(self, name : Optional[name.Name] =None, origin : Optional[name.Name] =None, relativize=True,
  26. override_rdclass : Optional[int] =None, **kw) -> bytes:
  27. ...
  28. def to_wire(self, name : Optional[name.Name], file : BytesIO, compress : Optional[Dict[name.Name, int]] = None, origin : Optional[name.Name] = None,
  29. override_rdclass : Optional[int] = None, want_shuffle=True) -> int:
  30. ...
  31. def match(self, rdclass : int, rdtype : int, covers : int) -> bool:
  32. ...
  33. def from_text_list(rdclass : Union[int,str], rdtype : Union[int,str], ttl : int, text_rdatas : str, idna_codec : Optional[name.IDNACodec] = None) -> rdataset.Rdataset:
  34. ...
  35. def from_text(rdclass : Union[int,str], rdtype : Union[int,str], ttl : int, *text_rdatas : str) -> rdataset.Rdataset:
  36. ...
  37. def from_rdata_list(ttl : int, rdatas : List[rdata.Rdata]) -> rdataset.Rdataset:
  38. ...
  39. def from_rdata(ttl : int, *rdatas : List[rdata.Rdata]) -> rdataset.Rdataset:
  40. ...