pub enum ConfigSource {
Default,
UserConfig,
ProjectConfig,
DotEnv,
Profile,
Environment,
CommandLine,
}Expand description
Where a configuration value originated.
Variants§
Default
Built-in default value.
UserConfig
User-level config file (~/.config/rch/config.toml).
ProjectConfig
Project-level config file (.rch/config.toml).
DotEnv
Loaded from .env or .rch.env file.
Profile
From a profile (dev/prod/test).
Environment
Environment variable.
CommandLine
Command-line argument (highest precedence).
Implementations§
Source§impl ConfigSource
impl ConfigSource
Sourcepub fn precedence(&self) -> u8
pub fn precedence(&self) -> u8
Get the precedence level (higher = takes priority).
Sourcepub fn display_name(&self) -> &'static str
pub fn display_name(&self) -> &'static str
Get a human-readable name for this source.
Trait Implementations§
Source§impl Clone for ConfigSource
impl Clone for ConfigSource
Source§fn clone(&self) -> ConfigSource
fn clone(&self) -> ConfigSource
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 ConfigSource
impl Debug for ConfigSource
Source§impl<'de> Deserialize<'de> for ConfigSource
impl<'de> Deserialize<'de> for ConfigSource
Source§fn 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
Source§impl Display for ConfigSource
impl Display for ConfigSource
Source§impl PartialEq for ConfigSource
impl PartialEq for ConfigSource
Source§fn eq(&self, other: &ConfigSource) -> bool
fn eq(&self, other: &ConfigSource) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ConfigSource
impl Serialize for ConfigSource
impl Copy for ConfigSource
impl Eq for ConfigSource
impl StructuralPartialEq for ConfigSource
Auto Trait Implementations§
impl Freeze for ConfigSource
impl RefUnwindSafe for ConfigSource
impl Send for ConfigSource
impl Sync for ConfigSource
impl Unpin for ConfigSource
impl UnsafeUnpin for ConfigSource
impl UnwindSafe for ConfigSource
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.