pub struct Config { /* private fields */ }
Expand description

Server configuration

Implementations§

source§

impl Config

source

pub fn read_config(path: &Path) -> ConfigResult<Self>

read a Config file from the file specified at path.

source

pub fn get_listen_addrs_ipv4(&self) -> Result<Vec<Ipv4Addr>, AddrParseError>

set of listening ipv4 addresses (for TCP and UDP)

source

pub fn get_listen_addrs_ipv6(&self) -> Result<Vec<Ipv6Addr>, AddrParseError>

set of listening ipv6 addresses (for TCP and UDP)

source

pub fn get_listen_port(&self) -> u16

port on which to listen for connections on specified addresses

source

pub fn get_tls_listen_port(&self) -> u16

port on which to listen for TLS connections

source

pub fn get_https_listen_port(&self) -> u16

port on which to listen for HTTPS connections

source

pub fn get_quic_listen_port(&self) -> u16

port on which to listen for QUIC connections

source

pub fn get_tcp_request_timeout(&self) -> Duration

default timeout for all TCP connections before forcibly shutdown

source

pub fn get_log_level(&self) -> Level

specify the log level which should be used, [“Trace”, “Debug”, “Info”, “Warn”, “Error”]

source

pub fn get_directory(&self) -> &Path

the path for all zone configurations, defaults to /var/named

source

pub fn get_zones(&self) -> &[ZoneConfig]

the set of zones which should be loaded

source

pub fn get_tls_cert(&self) -> Option<&TlsCertConfig>

the tls certificate to use for accepting tls connections

Trait Implementations§

source§

impl Debug for Config

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Config

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl FromStr for Config

§

type Err = Error

The associated error which can be returned from parsing.
source§

fn from_str(toml: &str) -> ConfigResult<Self>

Parses a string s to return a value of this type. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Config

§

impl Send for Config

§

impl Sync for Config

§

impl Unpin for Config

§

impl !UnwindSafe for Config

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,