bitwarden_error_macro/
args.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use darling::FromMeta;

#[derive(FromMeta)]
pub(crate) struct BitwardenErrorArgs {
    #[darling(flatten)]
    pub error_type: BitwardenErrorType,

    #[darling(default)]
    pub export_as: Option<String>,
}

#[derive(FromMeta)]
#[darling(rename_all = "snake_case")]
pub(crate) enum BitwardenErrorType {
    /// The error is going to be converted into a string using the `ToString` trait
    Basic,

    /// The error is going to be converted into a flat error using the `FlatError` trait
    Flat,

    /// The entire error stack is going to be made available using `serde`
    Full,
}