pub struct Config {
pub user: Option<String>,
pub group: Option<String>,
/* private fields */
}Expand description
Server configuration
Fields§
§user: Option<String>User to run the server as.
Only supported on Unix-like platforms. If the real or effective UID of the hickory process is root, we will attempt to change to this user (or to nobody if no user is specified here.)
group: Option<String>Group to run the server as.
Only supported on Unix-like platforms. If the real or effective UID of the hickory process is root, we will attempt to change to this group (or to nobody if no group is specified here.)
Implementations§
Source§impl Config
impl Config
Sourcepub fn read_config(path: &Path) -> Result<Self, ConfigError>
pub fn read_config(path: &Path) -> Result<Self, ConfigError>
read a Config file from the file specified at path.
Sourcepub fn from_toml(toml: &str) -> Result<Self, ConfigError>
pub fn from_toml(toml: &str) -> Result<Self, ConfigError>
Read a Config from the given TOML string.
Sourcepub fn listen_addrs_ipv4(&self) -> Result<Vec<Ipv4Addr>, AddrParseError>
pub fn listen_addrs_ipv4(&self) -> Result<Vec<Ipv4Addr>, AddrParseError>
set of listening ipv4 addresses (for TCP and UDP)
Sourcepub fn listen_addrs_ipv6(&self) -> Result<Vec<Ipv6Addr>, AddrParseError>
pub fn listen_addrs_ipv6(&self) -> Result<Vec<Ipv6Addr>, AddrParseError>
set of listening ipv6 addresses (for TCP and UDP)
Sourcepub fn listen_port(&self) -> u16
pub fn listen_port(&self) -> u16
port on which to listen for connections on specified addresses
Sourcepub fn tls_listen_port(&self) -> u16
pub fn tls_listen_port(&self) -> u16
port on which to listen for TLS connections
Sourcepub fn https_listen_port(&self) -> u16
pub fn https_listen_port(&self) -> u16
port on which to listen for HTTPS connections
Sourcepub fn quic_listen_port(&self) -> u16
pub fn quic_listen_port(&self) -> u16
port on which to listen for QUIC connections
Sourcepub fn h3_listen_port(&self) -> u16
pub fn h3_listen_port(&self) -> u16
port on which to listen for HTTP/3 connections
Sourcepub fn disable_tcp(&self) -> bool
pub fn disable_tcp(&self) -> bool
get if TCP protocol should be disabled
Sourcepub fn disable_udp(&self) -> bool
pub fn disable_udp(&self) -> bool
get if UDP protocol should be disabled
Sourcepub fn disable_tls(&self) -> bool
pub fn disable_tls(&self) -> bool
get if TLS protocol should be disabled
Sourcepub fn disable_https(&self) -> bool
pub fn disable_https(&self) -> bool
get if HTTPS protocol should be disabled
Sourcepub fn disable_quic(&self) -> bool
pub fn disable_quic(&self) -> bool
get if QUIC protocol should be disabled
Sourcepub fn tcp_request_timeout(&self) -> Duration
pub fn tcp_request_timeout(&self) -> Duration
default timeout for all TCP connections before forcibly shutdown
Sourcepub fn log_level(&self) -> Level
pub fn log_level(&self) -> Level
specify the log level which should be used, [“Trace”, “Debug”, “Info”, “Warn”, “Error”]
Sourcepub fn zones(&self) -> &[ZoneConfig]
pub fn zones(&self) -> &[ZoneConfig]
the set of zones which should be loaded
Sourcepub fn tls_cert(&self) -> Option<&TlsCertConfig>
pub fn tls_cert(&self) -> Option<&TlsCertConfig>
the tls certificate to use for accepting tls connections
Sourcepub fn deny_networks(&self) -> &[IpNet]
pub fn deny_networks(&self) -> &[IpNet]
get the networks denied access to this server
Sourcepub fn allow_networks(&self) -> &[IpNet]
pub fn allow_networks(&self) -> &[IpNet]
get the networks allowed to connect to this server