pub struct Config {
pub base: Path,
pub addrs: Vec<(SocketAddr, Auth)>,
pub tls: Option<Tls>,
pub default_auth: DefaultAuthMech,
pub default_bind_config: BindCfg,
}
Fields§
§base: Path
§addrs: Vec<(SocketAddr, Auth)>
§tls: Option<Tls>
§default_auth: DefaultAuthMech
§default_bind_config: BindCfg
Implementations§
Source§impl Config
impl Config
Sourcepub fn from_file(cfg: Config) -> Result<Config>
pub fn from_file(cfg: Config) -> Result<Config>
Transform a file::Config into a validated netidx config. Use this if you built a file::Config with the file::ConfigBuilder.
Sourcepub fn parse(s: &str) -> Result<Config>
pub fn parse(s: &str) -> Result<Config>
Parse and transform a file::Config into a validated netidx Config
Sourcepub fn default_auth(&self) -> DesiredAuth
pub fn default_auth(&self) -> DesiredAuth
Return the default DesiredAuth as specified by the config.
Sourcepub fn load<P: AsRef<FsPath>>(file: P) -> Result<Config>
pub fn load<P: AsRef<FsPath>>(file: P) -> Result<Config>
Load the config from the specified file.
Sourcepub fn to_referral(self) -> Referral
pub fn to_referral(self) -> Referral
Transform the config into a resolver Referral with a ttl that will never expire
Sourcepub fn load_default() -> Result<Config>
pub fn load_default() -> Result<Config>
This will try in order,
- $NETIDX_CFG
- ${dirs::config_dir}/netidx/client.json
- ${dirs::home_dir}/.config/netidx/client.json
- C:\netidx\client.json on windows
- /etc/netidx/client.json on unix
It will load the first file that exists, if that file fails to load then Err will be returned.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more