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 fn with_values(values: HashMap<String, ConfigValue>) -> Self
pub fn with_table_value(value: ConfigValue) -> Option<Self>
Sourcepub fn read_layer(
path: &Path,
definition_kind: DefinitionKind,
) -> CargoResult<Self>
pub fn read_layer( path: &Path, definition_kind: DefinitionKind, ) -> CargoResult<Self>
Loads configuration from a path without processing includes.
pub fn into_value(self) -> ConfigValue
pub fn definition(&self) -> &Definition
Sourcepub fn merge(&mut self, from: Self, force: bool) -> CargoResult<()>
pub fn merge(&mut self, from: Self, force: bool) -> CargoResult<()>
Merge the given values into self.
If force is true, primitive (non-container) types will override existing values
of equal priority. For arrays, incoming values of equal priority will be placed later.
Container types (tables and arrays) are merged with existing values.
Container and non-container types cannot be mixed.
pub fn values(&self) -> &HashMap<String, ConfigValue>
pub fn values_mut(&mut self) -> &mut HashMap<String, ConfigValue>
Sourcepub fn get_cv(&self, key: &ConfigKey) -> CargoResult<Option<ConfigValue>>
pub fn get_cv(&self, key: &ConfigKey) -> CargoResult<Option<ConfigValue>>
Get a configuration value by key.
This does NOT look at environment variables. See get_cv_with_env for
a variant that supports environment variables.
Trait Implementations§
Source§impl Debug for ConfigStore
impl Debug for ConfigStore
Auto Trait Implementations§
impl Forget for ConfigStore
impl Freeze for ConfigStore
impl RefUnwindSafe for ConfigStore
impl Send for ConfigStore
impl Sync for ConfigStore
impl Unpin for ConfigStore
impl UnsafeUnpin for ConfigStore
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§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: 64 bytes