Releases: x52dev/confik
Releases · x52dev/confik
confik: v0.15.11
- Add a new helper
MergingUnsetBuilderand traitMergingWithUnset, for aiding in building of customConfigurationimplementations. See the docs onMergingWithUnsetfor a worked example. - Fix
serde_json::Valuemerge when the first parsed config doesn't have any value set.
confik: v0.15.9
- No significant changes since
0.15.8.
confik: v0.15.10
- Add
#[confik(struct_default)]for struct fields: when no configuration data is present for that field, its value is taken from the same-named field on<Self as Default>::default(). Can be combined with#[confik(skip)](in place of an explicit#[confik(default)]). Cannot be combined with#[confik(default)]on the same field, and is not supported on enum variant fields (the configuration type must remain a struct). - Fix
#[confik(default = ...)]withfrom/try_from: when no data is merged, the default expression is evaluated as the target field type (after the macro’sInto::into), matching thestruct_defaultmissing-data path, instead of being forced to unify with the intermediate builder type.- Note although this was likely what your code was assuming (and was only working due to the implied
Into), this may break existing code.
- Note although this was likely what your code was assuming (and was only working due to the implied
confik: v0.15.8
- No significant changes since
0.15.7.
confik: v0.15.7
- No significant changes since
0.15.6.
confik: v0.15.6
- Implement
Configurationforjifftypes under thejiff-0_2feature flag: - Add
serde(with = ...)modules underconfik::jiffforOption<T>fields requiring non-default serialization formats:confik::jiff::timestamp::{second, millisecond, microsecond, nanosecond}::optional— integer epoch timestampsconfik::jiff::duration::friendly::compact::optional— friendly compact format forOption<SignedDuration>confik::jiff::span::friendly::compact::optional— friendly compact format forOption<Span>confik::jiff::unsigned_duration::optionalandconfik::jiff::unsigned_duration::friendly::compact::optional— ISO 8601 and friendly compact format forOption<std::time::Duration>
confik: v0.15.5
- Add RON source support behind new crate feature
ron-0_12(off-by-default). - Add YAML source support behind new crate feature
yaml_serde-0_10(off-by-default).
confik: v0.15.4
- Add
serde(with = ...)moduleconfik::humantimeunder thehumantimefeature flag, forhumantimesupport viaserde_humantimefor the builder ofOption<Duration>. E.g.#[derive(Debug, PartialEq, Eq, Configuration)] struct Config { #[confik(forward(serde(with = "confik::humantime::option")))] timeout: Option<Duration>, }
confik: v0.15.3
- Implement
Configurationforserde_json::Value- This is a very simple way to implement
try_from, see the foreign_type_via_value for an example.
- This is a very simple way to implement
confik: v0.15.2
- Add hot-reloadable configuration support with
ReloadableConfigtrait andReloadingConfigwrapper. Requires thereloadingfeature (depends onarc-swap).ReloadableConfigtrait defines how to build a configuration instance.ReloadingConfig<T, F>provides lock-free atomic configuration swapping.- Optional callbacks via
with_on_update()for reload notifications. - Optional SIGHUP signal handler via
spawn_signal_handler()(requiressignalfeature, depends onsignal-hook). - Optional tracing support for logging reload errors (requires
tracingfeature).
- Update
tomldependency to1. This means config files now support the TOML v1.1 spec with some new features. - Fix
try_fromfailure error, path now includes the (previously missing) failed field's name. - Minimum supported Rust version (MSRV) is now 1.81.