diff --git a/CHANGELOG.md b/CHANGELOG.md index 90d35f5e..a16d6f28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.4.0] - 2022-05-11 + ### Added * Added support for custom handling of settings updates. * `Option` support added to enable run-time settings tree presence. @@ -47,7 +49,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Library initially released on crates.io -[Unreleased]: https://github.com/quartiq/miniconf/compare/v0.3.0...HEAD +[Unreleased]: https://github.com/quartiq/miniconf/compare/v0.4.0...HEAD +[0.4.0]: https://github.com/quartiq/miniconf/compare/v0.3.0...v0.4.0 [0.3.0]: https://github.com/quartiq/miniconf/releases/tag/v0.3.0 [0.2.0]: https://github.com/quartiq/miniconf/releases/tag/v0.2.0 [0.1.0]: https://github.com/quartiq/miniconf/releases/tag/v0.1.0 diff --git a/Cargo.toml b/Cargo.toml index 322aa9ce..f567a613 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,9 @@ [package] name = "miniconf" -version = "0.3.0" + +# Don't forget to change `derive_miniconf`'s version as well. +version = "0.4.0" + authors = ["James Irwin ", "Ryan Summers /settings/internal` directly. If this is desired, instead derive `MiniconfAtomic` on the -`struct Data` definition. In this way, all members of `struct Data` must be updated simultaneously. - -# Settings Values - -MiniConf relies on using [`serde`](https://github.com/serde-rs/serde) for defining a -de/serialization method for settings. Currently, MiniConf only supports serde-json de/serialization -formats, although more formats may be supported in the future. diff --git a/derive_miniconf/Cargo.toml b/derive_miniconf/Cargo.toml index 6579275e..d05b2c60 100644 --- a/derive_miniconf/Cargo.toml +++ b/derive_miniconf/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "derive_miniconf" -version = "0.3.0" +version = "0.4.0" authors = ["James Irwin ", "Ryan Summers = miniconf::MqttClient::new( +//! std_embedded_nal::Stack::default(), +//! "example-device", +//! "quartiq/miniconf-sample", +//! "127.0.0.1".parse().unwrap(), +//! std_embedded_time::StandardClock::default(), +//! Settings::default(), +//! ) +//! .unwrap(); +//! +//! loop { +//! // Continually process client updates to detect settings changes. +//! if client.update().unwrap() { +//! println!("Settings updated: {:?}", client.settings()); +//! } +//! } +//! +//! ``` +//! //! ### Path iteration //! //! Miniconf also allows iteration over all settings paths: @@ -72,14 +107,6 @@ //! } //! ``` //! -//! ## Supported Protocols -//! -//! Miniconf is designed to be protocol-agnostic. Any means that you have of receiving input from -//! some external source can be used to acquire paths and values for updating settings. -//! -//! While Miniconf is platform agnostic, there is an [MQTT-based client](MqttClient) provided to -//! manage settings via the [MQTT protocol](https://mqtt.org). -//! //! ## Limitations //! //! Minconf cannot be used with some of Rust's more complex types. Some unsupported types: @@ -90,9 +117,11 @@ mod mqtt_client; mod array; -pub mod iter; mod option; +/// Provides iteration utilities over [Miniconf] structures. +pub mod iter; + #[cfg(feature = "mqtt-client")] pub use mqtt_client::MqttClient; @@ -194,6 +223,7 @@ pub struct MiniconfMetadata { pub max_depth: usize, } +/// Derive-able trait for structures that can be mutated using serialized paths and values. pub trait Miniconf { /// Update settings directly from a string path and data. ///