Trait trust_dns::client::ClientHandle
[−]
[src]
pub trait ClientHandle: Clone { fn send(&self, message: Message) -> Box<Future<Item=Message, Error=ClientError>>; fn query(&self,
name: Name,
query_class: DNSClass,
query_type: RecordType)
-> Box<Future<Item=Message, Error=ClientError>> { ... } fn create(&self,
record: Record,
zone_origin: Name)
-> Box<Future<Item=Message, Error=ClientError>> { ... } fn append(&self,
record: Record,
zone_origin: Name,
must_exist: bool)
-> Box<Future<Item=Message, Error=ClientError>> { ... } fn compare_and_swap(&self,
current: Record,
new: Record,
zone_origin: Name)
-> Box<Future<Item=Message, Error=ClientError>> { ... } fn delete_by_rdata(&self,
record: Record,
zone_origin: Name)
-> Box<Future<Item=Message, Error=ClientError>> { ... } fn delete_rrset(&self,
record: Record,
zone_origin: Name)
-> Box<Future<Item=Message, Error=ClientError>> { ... } fn delete_all(&self,
name_of_records: Name,
zone_origin: Name,
dns_class: DNSClass)
-> Box<Future<Item=Message, Error=ClientError>> { ... } }
A trait for implementing high level functions of DNS.
Required Methods
fn send(&self, message: Message) -> Box<Future<Item=Message, Error=ClientError>>
Send a message via the channel in the client
Arguments
message
- the fully constructed Message to send, note that most implementations of will most likely be required to rewrite the QueryId, do no rely on that as being stable.
Provided Methods
fn query(&self,
name: Name,
query_class: DNSClass,
query_type: RecordType)
-> Box<Future<Item=Message, Error=ClientError>>
name: Name,
query_class: DNSClass,
query_type: RecordType)
-> Box<Future<Item=Message, Error=ClientError>>
A classic DNS query
Note As of now, this will not recurse on PTR or CNAME record responses, that is up to the caller.
Arguments
name
- the label to lookupquery_class
- most likely this should always be DNSClass::INquery_type
- record type to lookup
fn create(&self,
record: Record,
zone_origin: Name)
-> Box<Future<Item=Message, Error=ClientError>>
record: Record,
zone_origin: Name)
-> Box<Future<Item=Message, Error=ClientError>>
Sends a record to create on the server, this will fail if the record exists (atomicity depends on the server)
RFC 2136, DNS Update, April 1997
2.4.3 - RRset Does Not Exist
No RRs with a specified NAME and TYPE (in the zone and class denoted
by the Zone Section) can exist.
For this prerequisite, a requestor adds to the section a single RR
whose NAME and TYPE are equal to that of the RRset whose nonexistence
is required. The RDLENGTH of this record is zero (0), and RDATA
field is therefore empty. CLASS must be specified as NONE in order
to distinguish this condition from a valid RR whose RDLENGTH is
naturally zero (0) (for example, the NULL RR). TTL must be specified
as zero (0).
2.5.1 - Add To An RRset
RRs are added to the Update Section whose NAME, TYPE, TTL, RDLENGTH
and RDATA are those being added, and CLASS is the same as the zone
class. Any duplicate RRs will be silently ignored by the primary
master.
Arguments
record
- the name of the record to createzone_origin
- the zone name to update, i.e. SOA name
The update must go to a zone authority (i.e. the server used in the ClientConnection)
fn append(&self,
record: Record,
zone_origin: Name,
must_exist: bool)
-> Box<Future<Item=Message, Error=ClientError>>
record: Record,
zone_origin: Name,
must_exist: bool)
-> Box<Future<Item=Message, Error=ClientError>>
Appends a record to an existing rrset, optionally require the rrset to exis (atomicity depends on the server)
RFC 2136, DNS Update, April 1997
2.4.1 - RRset Exists (Value Independent)
At least one RR with a specified NAME and TYPE (in the zone and class
specified in the Zone Section) must exist.
For this prerequisite, a requestor adds to the section a single RR
whose NAME and TYPE are equal to that of the zone RRset whose
existence is required. RDLENGTH is zero and RDATA is therefore
empty. CLASS must be specified as ANY to differentiate this
condition from that of an actual RR whose RDLENGTH is naturally zero
(0) (e.g., NULL). TTL is specified as zero (0).
2.5.1 - Add To An RRset
RRs are added to the Update Section whose NAME, TYPE, TTL, RDLENGTH
and RDATA are those being added, and CLASS is the same as the zone
class. Any duplicate RRs will be silently ignored by the primary
master.
Arguments
record
- the record to append to an RRSetzone_origin
- the zone name to update, i.e. SOA namemust_exist
- if true, the request will fail if the record does not exist
The update must go to a zone authority (i.e. the server used in the ClientConnection). If the rrset does not exist and must_exist is false, then the RRSet will be created.
fn compare_and_swap(&self,
current: Record,
new: Record,
zone_origin: Name)
-> Box<Future<Item=Message, Error=ClientError>>
current: Record,
new: Record,
zone_origin: Name)
-> Box<Future<Item=Message, Error=ClientError>>
Compares and if it matches, swaps it for the new value (atomicity depends on the server)
2.4.2 - RRset Exists (Value Dependent)
A set of RRs with a specified NAME and TYPE exists and has the same
members with the same RDATAs as the RRset specified here in this
section. While RRset ordering is undefined and therefore not
significant to this comparison, the sets be identical in their
extent.
For this prerequisite, a requestor adds to the section an entire
RRset whose preexistence is required. NAME and TYPE are that of the
RRset being denoted. CLASS is that of the zone. TTL must be
specified as zero (0) and is ignored when comparing RRsets for
identity.
2.5.4 - Delete An RR From An RRset
RRs to be deleted are added to the Update Section. The NAME, TYPE,
RDLENGTH and RDATA must match the RR being deleted. TTL must be
specified as zero (0) and will otherwise be ignored by the primary
master. CLASS must be specified as NONE to distinguish this from an
RR addition. If no such RRs exist, then this Update RR will be
silently ignored by the primary master.
2.5.1 - Add To An RRset
RRs are added to the Update Section whose NAME, TYPE, TTL, RDLENGTH
and RDATA are those being added, and CLASS is the same as the zone
class. Any duplicate RRs will be silently ignored by the primary
master.
Arguements
current
- the current current which must exist for the swap to completenew
- the new record with which to replace the current recordzone_origin
- the zone name to update, i.e. SOA name
The update must go to a zone authority (i.e. the server used in the ClientConnection).
fn delete_by_rdata(&self,
record: Record,
zone_origin: Name)
-> Box<Future<Item=Message, Error=ClientError>>
record: Record,
zone_origin: Name)
-> Box<Future<Item=Message, Error=ClientError>>
Deletes a record (by rdata) from an rrset, optionally require the rrset to exist.
RFC 2136, DNS Update, April 1997
2.4.1 - RRset Exists (Value Independent)
At least one RR with a specified NAME and TYPE (in the zone and class
specified in the Zone Section) must exist.
For this prerequisite, a requestor adds to the section a single RR
whose NAME and TYPE are equal to that of the zone RRset whose
existence is required. RDLENGTH is zero and RDATA is therefore
empty. CLASS must be specified as ANY to differentiate this
condition from that of an actual RR whose RDLENGTH is naturally zero
(0) (e.g., NULL). TTL is specified as zero (0).
2.5.4 - Delete An RR From An RRset
RRs to be deleted are added to the Update Section. The NAME, TYPE,
RDLENGTH and RDATA must match the RR being deleted. TTL must be
specified as zero (0) and will otherwise be ignored by the primary
master. CLASS must be specified as NONE to distinguish this from an
RR addition. If no such RRs exist, then this Update RR will be
silently ignored by the primary master.
Arguments
record
- the record to delete from a RRSet, the name, type and rdata must match the record to deletezone_origin
- the zone name to update, i.e. SOA namesigner
- the signer, with private key, to use to sign the request
The update must go to a zone authority (i.e. the server used in the ClientConnection). If the rrset does not exist and must_exist is false, then the RRSet will be deleted.
fn delete_rrset(&self,
record: Record,
zone_origin: Name)
-> Box<Future<Item=Message, Error=ClientError>>
record: Record,
zone_origin: Name)
-> Box<Future<Item=Message, Error=ClientError>>
Deletes an entire rrset, optionally require the rrset to exist.
RFC 2136, DNS Update, April 1997
2.4.1 - RRset Exists (Value Independent)
At least one RR with a specified NAME and TYPE (in the zone and class
specified in the Zone Section) must exist.
For this prerequisite, a requestor adds to the section a single RR
whose NAME and TYPE are equal to that of the zone RRset whose
existence is required. RDLENGTH is zero and RDATA is therefore
empty. CLASS must be specified as ANY to differentiate this
condition from that of an actual RR whose RDLENGTH is naturally zero
(0) (e.g., NULL). TTL is specified as zero (0).
2.5.2 - Delete An RRset
One RR is added to the Update Section whose NAME and TYPE are those
of the RRset to be deleted. TTL must be specified as zero (0) and is
otherwise not used by the primary master. CLASS must be specified as
ANY. RDLENGTH must be zero (0) and RDATA must therefore be empty.
If no such RRset exists, then this Update RR will be silently ignored
by the primary master.
Arguments
record
- the record to delete from a RRSet, the name, and type must match the record set to deletezone_origin
- the zone name to update, i.e. SOA namesigner
- the signer, with private key, to use to sign the request
The update must go to a zone authority (i.e. the server used in the ClientConnection). If the rrset does not exist and must_exist is false, then the RRSet will be deleted.
fn delete_all(&self,
name_of_records: Name,
zone_origin: Name,
dns_class: DNSClass)
-> Box<Future<Item=Message, Error=ClientError>>
name_of_records: Name,
zone_origin: Name,
dns_class: DNSClass)
-> Box<Future<Item=Message, Error=ClientError>>
Deletes all records at the specified name
RFC 2136, DNS Update, April 1997
2.5.3 - Delete All RRsets From A Name
One RR is added to the Update Section whose NAME is that of the name
to be cleansed of RRsets. TYPE must be specified as ANY. TTL must
be specified as zero (0) and is otherwise not used by the primary
master. CLASS must be specified as ANY. RDLENGTH must be zero (0)
and RDATA must therefore be empty. If no such RRsets exist, then
this Update RR will be silently ignored by the primary master.
Arguments
name_of_records
- the name of all the record sets to deletezone_origin
- the zone name to update, i.e. SOA namedns_class
- the class of the SOAsigner
- the signer, with private key, to use to sign the request
The update must go to a zone authority (i.e. the server used in the ClientConnection). This operation attempts to delete all resource record sets the the specified name reguardless of the record type.
Implementors
impl ClientHandle for BasicClientHandle
impl<H> ClientHandle for MemoizeClientHandle<H> where H: ClientHandle
impl<H> ClientHandle for RetryClientHandle<H> where H: ClientHandle + 'static
impl<H> ClientHandle for SecureClientHandle<H> where H: ClientHandle + 'static