thisctx 0.4.0

Easily create error with contexts
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use thisctx::WithContext;

#[derive(WithContext)]
#[thisctx(no_generic)]
enum Error {
    #[thisctx(generic)]
    GeneratedGeneric(String),
    #[thisctx(generic)]
    NoGeneratedGenericOnField(String, #[thisctx(no_generic)] String, String),
    NoGeneratedGeneric(String),
}

#[test]
fn attr_generic() {
    let _ = NoGeneratedGenericOnField::<&str, &str>("What's", "going".to_owned(), "on");
}