pub struct ConfigBuilder { /* private fields */ }Expand description
Builder for Config - the “explicit constructor/config value” tier of
the precedence chain.
Any field set here is pinned above every environment variable and the config file; unset fields fall through the canonical env vars, the legacy aliases, and the user config file.
Implementations§
Source§impl ConfigBuilder
impl ConfigBuilder
pub fn new() -> Self
Sourcepub fn account_id(self, value: impl Into<String>) -> Self
pub fn account_id(self, value: impl Into<String>) -> Self
Pin the account ID (non-secret).
Sourcepub fn api_token(self, value: impl Into<String>) -> Self
pub fn api_token(self, value: impl Into<String>) -> Self
Pin the API token (secret - held as SecretString on resolution).
Sourcepub fn config_path(self, value: impl Into<PathBuf>) -> Self
pub fn config_path(self, value: impl Into<PathBuf>) -> Self
Pin the user config file path.
Sourcepub fn build(self) -> Result<Config, CloudflareError>
pub fn build(self) -> Result<Config, CloudflareError>
Resolve through the full precedence chain.
Trait Implementations§
Source§impl Clone for ConfigBuilder
impl Clone for ConfigBuilder
Source§fn clone(&self) -> ConfigBuilder
fn clone(&self) -> ConfigBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConfigBuilder
impl Debug for ConfigBuilder
Source§impl Default for ConfigBuilder
impl Default for ConfigBuilder
Source§fn default() -> ConfigBuilder
fn default() -> ConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ConfigBuilder
impl RefUnwindSafe for ConfigBuilder
impl Send for ConfigBuilder
impl Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl UnsafeUnpin for ConfigBuilder
impl UnwindSafe for ConfigBuilder
Blanket Implementations§
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