summaryrefslogtreecommitdiffstats
path: root/src/config.rs
AgeCommit message (Collapse)Author
2021-03-14Rename try_into/try_fromMatthias Beyer
Because of the clash in names with the TryInto and TryFrom traits, we're renaming the functions here to try_serialize/try_deserialize. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-03-14Merge branch 'builder'Matthias Beyer
2021-03-13Add Config::with_merged()Matthias Beyer
This patch adds a builder-pattern version of Config::merge(), which can be used for method-chain-building Config objects. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-03-13Add a Config::set_once() function to set a value once (and let ↵Matthias Beyer
Config::merge() overwrite it later Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-10-01Run cargo-fmtMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-03-14General upgrade for clippy fix and remove of deprecated methods for errorsFederico Pasqua
2019-12-07Remove automatic lowercaseRyan Leckey
2019-05-09Remove ValueWithKey structGuillem Nieto
While using this library, I end up having lifetime issues with `Config::get`. I've seen that current implementation forces the calleer to match `key` lifetime to the output of the function. My use case is, under some circumstances, return a suffixed version of the config key. Something similar to: ``` if some_condition == true { let key_name = format!("{}_suffix", key); self.config.get(&key_name) } else { self.config.get(key) } ``` This code is noy compiling for me due to conflicting lifetimes. To avoid this, I've started looking to the code and I've found that `key` needed this lifetime because of `ValueWithKey`. The purpouse of this struct seems to be add more information to the errors that are returned to the user. To mitigate this lifetime coupling I've: - Mapped the error on `Config::get` to include the originating key of the current error - Remove all the code related with `ValueWithKey`
2019-05-09Remove try_defaults_from and set_defaults (for now) as '#[serde(default)]' ↵Ryan Leckey
works thanks to #106
2019-04-08Add missing doctyranron
2019-04-08Fix annoying 'invalid type: unit value, expected struct Settings' errortyranron
2019-04-08Bootstrap solutiontyranron
2018-07-02Run rustfmt (nightly)Ryan Leckey
2018-04-06Add config serialize abilityXX
2017-08-05Fix tests and put back .deserialize as deprecated0.7.0Ryan Leckey
2017-07-30Impl Deserializer for Config (to forward Value)Ryan Leckey
2017-07-30Impl Config for Source to allow merging whole configs; closes #28Ryan Leckey
2017-07-30Remove ConfigResult; close #36Ryan Leckey
2017-06-23Clean up ConfigResult type. Make it more ergonomic to use.Ryan Leckey
2017-06-22Implement Source for Vec<T: Source> and From<Path> for FileRyan Leckey
2017-06-22Add builder API to ConfigRyan Leckey
2017-06-16Fix a couple issues, mainly with env sourceRyan Leckey
2017-06-13Ensure config keys are case insensitiveRyan Leckey
2017-06-13Add more tests on filesRyan Leckey
2017-06-13:shirt: Fix clippy warningsRyan Leckey
2017-06-03Add set and set_default (and deep merging)Ryan Leckey
2017-06-01Move things around and get some tests in placeRyan Leckey
2017-03-08Initial work on deep serde integrationRyan Leckey
2017-02-12Decorate Box<Source> with Send + SyncRyan Leckey
2017-02-12Remove global APIRyan Leckey
2017-02-11Move to copy API instead of reference; fixes #9Ryan Leckey
2017-02-08Implement 'namespace' on FileRyan Leckey
2017-02-07:shirt:Ryan Leckey
2017-02-07:shirt:Ryan Leckey
2017-02-07Merge branch 'master' of https://github.com/mehcode/config-rsRyan Leckey
2017-02-07Add path resolution using a strict subset of JSONPathRyan Leckey
2017-02-02Add slice support and auto conversion of hash/slice setsRyan Leckey
2017-02-02Add support for Table/Array and deep merging of configuration valuesRyan Leckey
2017-01-30:shirt:Ryan Leckey
2017-01-28Propagate Cow into SourceRyan Leckey
2017-01-28Use 'Cow' to remove unnecessary allocationsRyan Leckey
2017-01-27Move 'Envrionment' into its own sourceRyan Leckey
2017-01-26Refactor the file source to allow for N formats; implement JSON.Ryan Leckey
2017-01-26:green_heart:Ryan Leckey
2017-01-25:fire:Ryan Leckey
2017-01-25Big cleanup of the Value APIRyan Leckey
2017-01-24Add API to access global configRyan Leckey