serde-semver: Serde-compatible version checker
This crate provides a derive macro SemverReq
to build a versioned marker type.
For example, it assocates the type with version "3.1.4".
;
The marker type works as a version checker during deserialization. In this example, the marker verifies whether the deserialized JSON text is is compatible with version "3.1.4". For example, "3.1.3" and "3.1.0" are valid versions, but "3.2.0" and "2.7.0" are not.
use Version;
use ;
use PathBuf;
use SemverReq;
;
// An example configuration with version tag
// The version is audited during deserialization.
let config: Config = from_str
.unwrap;
// The version is recovered after serialization.
assert_eq!;
License
MIT license. See LICENSE.txt file.