Releases: mcmah309/error_set
Releases · mcmah309/error_set
v0.5.4
- Support constant
#[display(...)]
attributes for#![no_std]
Full Changelog: v0.5.3...v0.5.4
v0.5.3
Full Changelog: v0.5.1...v0.5.3
v0.5.1
- Support
no_std
Full Changelog: v0.5.0...v0.5.1
v0.5.0
Inline Structs and Custom Display Messages
Error sets now support inline structs and custom display messages. Similar to thiserror
. Just
add the #[display(...)]
attribute to the variant.
error_set! {
SetX = {
#[display("My name is {} and my age is {}", name, age)]
A {
name: String,
age: u32,
},
#[display("This is the display message for B")]
B,
IoError(std::io::Error),
};
SetY = {
C,
} || SetX;
}
fn main() {
let x = SetX::A {
name: "john".to_string(),
age: 32,
};
assert_eq!(x.to_string(), "My name is john and my age is 32".to_string());
}
You can redeclare the same inline struct in a different set, change the display message, and conversion between sets will still work.
Full Changelog: v0.4.5...v0.5.0
v0.4.5
- Add more context methods for tracing/log features
Full Changelog: v0.4.4...v0.4.5
v0.4.4
- Add more context methods for
tracing
/log
features
Full Changelog: v0.4.2...v0.4.4
v0.4.2
- Improved parsing - better error messages and spans. Writing error sets will feel even more like native Rust.
Full Changelog: v0.4.1...v0.4.2
v0.4.1
- Add
RecordContext
doc to crates.io
Full Changelog: v0.4.0...v0.4.1
v0.4.0
- Breaking: Move
coerce!
macro to behind a feature flag - Add
tracing
crate support behindtracing
feature flag - Add
log
crate support behindlog
feature flag
Full Changelog: v0.3.2...v0.4.0
v0.3.2
Full Changelog: v0.3.1...v0.3.2