pub struct ConfigStore {
values: HashMap<String, ConfigValue>,
def: Definition,
}Fields§
§values: HashMap<String, ConfigValue>A collection of configuration options
def: DefinitionImplementations§
Source§impl ConfigStore
impl ConfigStore
pub const fn new() -> Self
pub fn from_values(values: HashMap<String, ConfigValue>) -> Self
pub fn from_table_value(value: ConfigValue) -> Option<Self>
Sourcepub fn from_layers(layers: impl IntoIterator<Item = Self>) -> Result<Self>
pub fn from_layers(layers: impl IntoIterator<Item = Self>) -> Result<Self>
Merges config layers given from lowest to highest precedence.
A value with a higher-priority Definition wins regardless of its layer’s position.
Sourcepub fn read_layer(path: &Path, scope: Scope) -> Result<Self>
pub fn read_layer(path: &Path, scope: Scope) -> Result<Self>
Loads configuration from a path without processing includes.
Sourcepub fn parse_cli_key_value(arg: &str) -> Result<Self>
pub fn parse_cli_key_value(arg: &str) -> Result<Self>
Parses a single inline KEY=VALUE argument into a configuration layer.
pub fn into_value(self) -> ConfigValue
pub fn definition(&self) -> &Definition
Sourcepub fn merge(&mut self, from: Self) -> Result<()>
pub fn merge(&mut self, from: Self) -> Result<()>
Merge the given values into self.
See ConfigValue::merge for how values are merged.
pub fn values(&self) -> &HashMap<String, ConfigValue>
pub fn values_mut(&mut self) -> &mut HashMap<String, ConfigValue>
Trait Implementations§
Source§impl Debug for ConfigStore
impl Debug for ConfigStore
Auto Trait Implementations§
impl Forget for ConfigStore
impl Freeze for ConfigStorewhere
*const u8 is !null: Freeze,
PhantomData<(String, ConfigValue)>: Freeze,
PhantomData<u8>: Freeze,
impl Move for ConfigStore
impl RefUnwindSafe for ConfigStore
impl Send for ConfigStore
impl Sync for ConfigStore
impl Unpin for ConfigStore
impl UnsafeUnpin for ConfigStorewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<(String, ConfigValue)>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
impl UnwindSafe for ConfigStore
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 72 bytes