Trait trust_dns_server::authority::Authority
source · [−]pub trait Authority: Send + Sync {
type Lookup: Send + Sync + Sized + 'static;
fn zone_type(&self) -> ZoneType;
fn is_axfr_allowed(&self) -> bool;
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
update: &'life1 MessageRequest
) -> Pin<Box<dyn Future<Output = UpdateResult<bool>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn origin(&self) -> &LowerName;
fn lookup<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 LowerName,
rtype: RecordType,
lookup_options: LookupOptions
) -> Pin<Box<dyn Future<Output = Result<Self::Lookup, LookupError>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
request: RequestInfo<'life1>,
lookup_options: LookupOptions
) -> Pin<Box<dyn Future<Output = Result<Self::Lookup, LookupError>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn get_nsec_records<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 LowerName,
lookup_options: LookupOptions
) -> Pin<Box<dyn Future<Output = Result<Self::Lookup, LookupError>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn ns<'life0, 'async_trait>(
&'life0 self,
lookup_options: LookupOptions
) -> Pin<Box<dyn Future<Output = Result<Self::Lookup, LookupError>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait,
{ ... }
fn soa<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Self::Lookup, LookupError>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait,
{ ... }
fn soa_secure<'life0, 'async_trait>(
&'life0 self,
lookup_options: LookupOptions
) -> Pin<Box<dyn Future<Output = Result<Self::Lookup, LookupError>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait,
{ ... }
}
Expand description
Authority implementations can be used with a Catalog
Associated Types
Required methods
fn is_axfr_allowed(&self) -> bool
fn is_axfr_allowed(&self) -> bool
Return true if AXFR is allowed
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
update: &'life1 MessageRequest
) -> Pin<Box<dyn Future<Output = UpdateResult<bool>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
update: &'life1 MessageRequest
) -> Pin<Box<dyn Future<Output = UpdateResult<bool>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Perform a dynamic update of a zone
Get the origin of this zone, i.e. example.com is the origin for www.example.com
fn lookup<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 LowerName,
rtype: RecordType,
lookup_options: LookupOptions
) -> Pin<Box<dyn Future<Output = Result<Self::Lookup, LookupError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn lookup<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 LowerName,
rtype: RecordType,
lookup_options: LookupOptions
) -> Pin<Box<dyn Future<Output = Result<Self::Lookup, LookupError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Looks up all Resource Records matching the giving Name
and RecordType
.
Arguments
name
- TheName
, label, to lookup.rtype
- TheRecordType
, to lookup.RecordType::ANY
will return all records matchingname
.RecordType::AXFR
will return all record types exceptRecordType::SOA
due to the requirements that on zone transfers theRecordType::SOA
must both precede and follow all other records.is_secure
- If the DO bit is set on the EDNS OPT record, then return RRSIGs as well.
Return value
None if there are no matching records, otherwise a Vec
containing the found records.
fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
request: RequestInfo<'life1>,
lookup_options: LookupOptions
) -> Pin<Box<dyn Future<Output = Result<Self::Lookup, LookupError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
request: RequestInfo<'life1>,
lookup_options: LookupOptions
) -> Pin<Box<dyn Future<Output = Result<Self::Lookup, LookupError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Using the specified query, perform a lookup against this zone.
Arguments
query
- the query to perform the lookup with.is_secure
- if true, then RRSIG records (if this is a secure zone) will be returned.
Return value
Returns a vectory containing the results of the query, it will be empty if not found. If
is_secure
is true, in the case of no records found then NSEC records will be returned.
fn get_nsec_records<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 LowerName,
lookup_options: LookupOptions
) -> Pin<Box<dyn Future<Output = Result<Self::Lookup, LookupError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_nsec_records<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 LowerName,
lookup_options: LookupOptions
) -> Pin<Box<dyn Future<Output = Result<Self::Lookup, LookupError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: '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 thisis_secure
- if true then it will return RRSIG records as well
Provided methods
fn ns<'life0, 'async_trait>(
&'life0 self,
lookup_options: LookupOptions
) -> Pin<Box<dyn Future<Output = Result<Self::Lookup, LookupError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn ns<'life0, 'async_trait>(
&'life0 self,
lookup_options: LookupOptions
) -> Pin<Box<dyn Future<Output = Result<Self::Lookup, LookupError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Get the NS, NameServer, record for the zone
Returns the SOA of the authority.
Note: This will only return the SOA, if this is fulfilling a request, a standard lookup
should be used, see soa_secure()
, which will optionally return RRSIGs.
fn soa_secure<'life0, 'async_trait>(
&'life0 self,
lookup_options: LookupOptions
) -> Pin<Box<dyn Future<Output = Result<Self::Lookup, LookupError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn soa_secure<'life0, 'async_trait>(
&'life0 self,
lookup_options: LookupOptions
) -> Pin<Box<dyn Future<Output = Result<Self::Lookup, LookupError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Returns the SOA record for the zone
Implementors
sourceimpl Authority for FileAuthority
impl Authority for FileAuthority
type Lookup = <InMemoryAuthority as Authority>::Lookup
sourceimpl Authority for ForwardAuthority
impl Authority for ForwardAuthority
type Lookup = ForwardLookup
sourceimpl Authority for InMemoryAuthority
impl Authority for InMemoryAuthority
type Lookup = AuthLookup
sourceimpl Authority for SqliteAuthority
This is supported on crate feature sqlite
only.
impl Authority for SqliteAuthority
sqlite
only.