Struct trust_dns_server::config::ZoneConfig
source · [−]pub struct ZoneConfig {
pub zone: String,
pub zone_type: ZoneType,
pub file: Option<String>,
pub allow_update: Option<bool>,
pub allow_axfr: Option<bool>,
pub enable_dnssec: Option<bool>,
pub keys: Vec<KeyConfig>,
pub stores: Option<StoreConfig>,
}
Expand description
Configuration for a zone
Fields
zone: String
name of the zone
zone_type: ZoneType
type of the zone
file: Option<String>
location of the file (short for StoreConfig::FileConfig{zone_file_path})
allow_update: Option<bool>
Deprecated allow_update, this is a Store option
allow_axfr: Option<bool>
Allow AXFR (TODO: need auth)
enable_dnssec: Option<bool>
Enable DnsSec TODO: should this move to StoreConfig?
keys: Vec<KeyConfig>
Keys for use by the zone
stores: Option<StoreConfig>
Store configurations, TODO: allow chained Stores
Implementations
sourceimpl ZoneConfig
impl ZoneConfig
sourcepub fn new(
zone: String,
zone_type: ZoneType,
file: String,
allow_update: Option<bool>,
allow_axfr: Option<bool>,
enable_dnssec: Option<bool>,
keys: Vec<KeyConfig>
) -> Self
pub fn new(
zone: String,
zone_type: ZoneType,
file: String,
allow_update: Option<bool>,
allow_axfr: Option<bool>,
enable_dnssec: Option<bool>,
keys: Vec<KeyConfig>
) -> Self
Return a new zone configuration
Arguments
zone
- name of a zone, e.g. example.comzone_type
- Type of zone, e.g. Primary, Secondary, etc.file
- relative to Config base path, to the zone fileallow_update
- enable dynamic updatesallow_axfr
- enable AXFR transfersenable_dnssec
- enable signing of the zone for DNSSeckeys
- list of private and public keys used to sign a zone
sourcepub fn get_zone(&self) -> ProtoResult<Name>
pub fn get_zone(&self) -> ProtoResult<Name>
returns the name of the Zone, i.e. the example.com
of www.example.com.
sourcepub fn get_zone_type(&self) -> ZoneType
pub fn get_zone_type(&self) -> ZoneType
the type of the zone
sourcepub fn get_file(&self) -> PathBuf
pub fn get_file(&self) -> PathBuf
path to the zone file, i.e. the base set of original records in the zone
this is ony used on first load, if dynamic update is enabled for the zone, then the journal file is the actual source of truth for the zone.
sourcepub fn is_update_allowed(&self) -> bool
pub fn is_update_allowed(&self) -> bool
enable dynamic updates for the zone (see SIG0 and the registered keys)
sourcepub fn is_axfr_allowed(&self) -> bool
pub fn is_axfr_allowed(&self) -> bool
enable AXFR transfers
sourcepub fn is_dnssec_enabled(&self) -> bool
pub fn is_dnssec_enabled(&self) -> bool
declare that this zone should be signed, see keys for configuration of the keys for signing
Trait Implementations
sourceimpl Debug for ZoneConfig
impl Debug for ZoneConfig
sourceimpl<'de> Deserialize<'de> for ZoneConfig
impl<'de> Deserialize<'de> for ZoneConfig
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl PartialEq<ZoneConfig> for ZoneConfig
impl PartialEq<ZoneConfig> for ZoneConfig
sourcefn eq(&self, other: &ZoneConfig) -> bool
fn eq(&self, other: &ZoneConfig) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ZoneConfig) -> bool
fn ne(&self, other: &ZoneConfig) -> bool
This method tests for !=
.
impl StructuralPartialEq for ZoneConfig
Auto Trait Implementations
impl !RefUnwindSafe for ZoneConfig
impl Send for ZoneConfig
impl Sync for ZoneConfig
impl Unpin for ZoneConfig
impl !UnwindSafe for ZoneConfig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more