pub trait ZoneHandler: Send + Sync {
Show 13 methods
// Required methods
fn zone_type(&self) -> ZoneType;
fn axfr_policy(&self) -> AxfrPolicy;
fn origin(&self) -> &LowerName;
fn lookup<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
name: &'life1 LowerName,
rtype: RecordType,
request_info: Option<&'life2 RequestInfo<'life3>>,
lookup_options: LookupOptions,
) -> Pin<Box<dyn Future<Output = LookupControlFlow<AuthLookup>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 Request,
lookup_options: LookupOptions,
) -> Pin<Box<dyn Future<Output = (LookupControlFlow<AuthLookup>, Option<TSigResponseContext>)> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn nsec_records<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 LowerName,
lookup_options: LookupOptions,
) -> Pin<Box<dyn Future<Output = LookupControlFlow<AuthLookup>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn nsec3_records<'life0, 'life1, 'async_trait>(
&'life0 self,
info: Nsec3QueryInfo<'life1>,
lookup_options: LookupOptions,
) -> Pin<Box<dyn Future<Output = LookupControlFlow<AuthLookup>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn nx_proof_kind(&self) -> Option<&NxProofKind>;
fn metrics_label(&self) -> &'static str;
// Provided methods
fn can_validate_dnssec(&self) -> bool { ... }
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
_update: &'life1 Request,
_now: u64,
) -> Pin<Box<dyn Future<Output = (Result<bool, ResponseCode>, Option<TSigResponseContext>)> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn consult<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_name: &'life1 LowerName,
_rtype: RecordType,
_request_info: Option<&'life2 RequestInfo<'life3>>,
_lookup_options: LookupOptions,
last_result: LookupControlFlow<AuthLookup>,
) -> Pin<Box<dyn Future<Output = (LookupControlFlow<AuthLookup>, Option<TSigResponseContext>)> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait { ... }
fn zone_transfer<'life0, 'life1, 'async_trait>(
&'life0 self,
_request: &'life1 Request,
_lookup_options: LookupOptions,
_now: u64,
) -> Pin<Box<dyn Future<Output = Option<(Result<ZoneTransfer, LookupError>, Option<TSigResponseContext>)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}Expand description
ZoneHandler implementations can be used with a Catalog
Required Methods§
Sourcefn axfr_policy(&self) -> AxfrPolicy
fn axfr_policy(&self) -> AxfrPolicy
Return the policy for determining if AXFR requests are allowed
Sourcefn origin(&self) -> &LowerName
fn origin(&self) -> &LowerName
Get the origin of this zone, i.e. example.com is the origin for www.example.com
Sourcefn lookup<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
name: &'life1 LowerName,
rtype: RecordType,
request_info: Option<&'life2 RequestInfo<'life3>>,
lookup_options: LookupOptions,
) -> Pin<Box<dyn Future<Output = LookupControlFlow<AuthLookup>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn lookup<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
name: &'life1 LowerName,
rtype: RecordType,
request_info: Option<&'life2 RequestInfo<'life3>>,
lookup_options: LookupOptions,
) -> Pin<Box<dyn Future<Output = LookupControlFlow<AuthLookup>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Looks up all Resource Records matching the given Name and RecordType.
§Arguments
name- The name to look up.rtype- TheRecordTypeto look up.RecordType::ANYwill return all records matchingname.RecordType::AXFRwill return all record types exceptRecordType::SOAdue to the requirements that on zone transfers theRecordType::SOAmust both precede and follow all other records.request_info- TheRequestInfostructure for the request, if it is available.lookup_options- Query-related lookup options (e.g., DNSSEC DO bit, supported hash algorithms, etc.)
§Return value
A LookupControlFlow containing the lookup that should be returned to the client.
Sourcefn search<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 Request,
lookup_options: LookupOptions,
) -> Pin<Box<dyn Future<Output = (LookupControlFlow<AuthLookup>, Option<TSigResponseContext>)> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 Request,
lookup_options: LookupOptions,
) -> Pin<Box<dyn Future<Output = (LookupControlFlow<AuthLookup>, Option<TSigResponseContext>)> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Using the specified query, perform a lookup against this zone.
§Arguments
request- the query to perform the lookup with.lookup_options- Query-related lookup options (e.g., DNSSEC DO bit, supported hash algorithms, etc.)
§Return value
A LookupControlFlow containing the lookup that should be returned to the client.
An optional ResponseSigner to use to sign the response returned to the client.
Sourcefn nsec_records<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 LowerName,
lookup_options: LookupOptions,
) -> Pin<Box<dyn Future<Output = LookupControlFlow<AuthLookup>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn nsec_records<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 LowerName,
lookup_options: LookupOptions,
) -> Pin<Box<dyn Future<Output = LookupControlFlow<AuthLookup>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Return the NSEC records based on the given name
§Arguments
name- given this name (i.e. the lookup name), return the NSEC record that is less than thislookup_options- Query-related lookup options (e.g., DNSSEC DO bit, supported hash algorithms, etc.)
Sourcefn nsec3_records<'life0, 'life1, 'async_trait>(
&'life0 self,
info: Nsec3QueryInfo<'life1>,
lookup_options: LookupOptions,
) -> Pin<Box<dyn Future<Output = LookupControlFlow<AuthLookup>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Available on crate feature __dnssec only.
fn nsec3_records<'life0, 'life1, 'async_trait>(
&'life0 self,
info: Nsec3QueryInfo<'life1>,
lookup_options: LookupOptions,
) -> Pin<Box<dyn Future<Output = LookupControlFlow<AuthLookup>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
__dnssec only.Return the NSEC3 records based on the information available for a query.
Sourcefn nx_proof_kind(&self) -> Option<&NxProofKind>
Available on crate feature __dnssec only.
fn nx_proof_kind(&self) -> Option<&NxProofKind>
__dnssec only.Returns the kind of non-existence proof used for this zone.
Sourcefn metrics_label(&self) -> &'static str
Available on crate feature metrics only.
fn metrics_label(&self) -> &'static str
metrics only.Returns the zone handler metrics label.
Provided Methods§
Sourcefn can_validate_dnssec(&self) -> bool
fn can_validate_dnssec(&self) -> bool
Whether the zone handler can perform DNSSEC validation
Sourcefn update<'life0, 'life1, 'async_trait>(
&'life0 self,
_update: &'life1 Request,
_now: u64,
) -> Pin<Box<dyn Future<Output = (Result<bool, ResponseCode>, Option<TSigResponseContext>)> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
_update: &'life1 Request,
_now: u64,
) -> Pin<Box<dyn Future<Output = (Result<bool, ResponseCode>, Option<TSigResponseContext>)> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Perform a dynamic update of a zone
Sourcefn consult<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_name: &'life1 LowerName,
_rtype: RecordType,
_request_info: Option<&'life2 RequestInfo<'life3>>,
_lookup_options: LookupOptions,
last_result: LookupControlFlow<AuthLookup>,
) -> Pin<Box<dyn Future<Output = (LookupControlFlow<AuthLookup>, Option<TSigResponseContext>)> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn consult<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_name: &'life1 LowerName,
_rtype: RecordType,
_request_info: Option<&'life2 RequestInfo<'life3>>,
_lookup_options: LookupOptions,
last_result: LookupControlFlow<AuthLookup>,
) -> Pin<Box<dyn Future<Output = (LookupControlFlow<AuthLookup>, Option<TSigResponseContext>)> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Consulting lookup for all Resource Records matching the given Name and RecordType. This
will be called in a chained zone handler configuration after a zone handler in the chain has
returned a lookup with a LookupControlFlow::Continue action. Every other zone handler in the
chain will be called via this consult method, until one either returns a
LookupControlFlow::Break action, or all zone handlers have been consulted. The zone handler
that generated the primary lookup (the one returned via ‘lookup’) will not be consulted.
§Arguments
name- The name to look up.rtype- TheRecordTypeto look up.RecordType::ANYwill return all records matchingname.RecordType::AXFRwill return all record types exceptRecordType::SOAdue to the requirements that on zone transfers theRecordType::SOAmust both precede and follow all other records.request_info- TheRequestInfostructure for the request, if it is available.lookup_options- Query-related lookup options (e.g., DNSSEC DO bit, supported hash algorithms, etc.)last_result- The lookup returned by a previous zone handler in a chained configuration. If a subsequent zone handler does not modify this lookup, it will be returned to the client after consulting all zone handlers in the chain.
§Return value
A LookupControlFlow containing the lookup that should be returned to the client. This can be the same last_result that was passed in, or a new lookup, depending on the logic of the zone handler in question.
An optional ResponseSigner to use to sign the response returned to the client. If it is
None and an earlier zone handler provided Some, it will be ignored. If it is Some it
will be used to replace any previous ResponseSigner.
Sourcefn zone_transfer<'life0, 'life1, 'async_trait>(
&'life0 self,
_request: &'life1 Request,
_lookup_options: LookupOptions,
_now: u64,
) -> Pin<Box<dyn Future<Output = Option<(Result<ZoneTransfer, LookupError>, Option<TSigResponseContext>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn zone_transfer<'life0, 'life1, 'async_trait>(
&'life0 self,
_request: &'life1 Request,
_lookup_options: LookupOptions,
_now: u64,
) -> Pin<Box<dyn Future<Output = Option<(Result<ZoneTransfer, LookupError>, Option<TSigResponseContext>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns all records in the zone.
This will return None if the next zone handler in the zone handler chain should be used instead.
Implementors§
impl ZoneHandler for BlocklistZoneHandler
blocklist only.impl ZoneHandler for FileZoneHandler
impl<P: RuntimeProvider + Send + Sync> ZoneHandler for InMemoryZoneHandler<P>
impl<P: RuntimeProvider + Send + Sync> ZoneHandler for SqliteZoneHandler<P>
sqlite only.impl<P: RuntimeProvider> ZoneHandler for RecursiveZoneHandler<P>
recursor only.impl<P: ConnectionProvider> ZoneHandler for ForwardZoneHandler<P>
resolver only.