bitwarden_error_macro/args.rs
1use darling::FromMeta;
2
3#[derive(FromMeta)]
4pub(crate) struct BitwardenErrorArgs {
5 #[darling(flatten)]
6 pub error_type: BitwardenErrorType,
7
8 #[darling(default)]
9 pub export_as: Option<String>,
10}
11
12#[derive(FromMeta)]
13#[darling(rename_all = "snake_case")]
14pub(crate) enum BitwardenErrorType {
15 /// The error is going to be converted into a string using the `ToString` trait
16 Basic,
17
18 /// The error is going to be converted into a flat error using the `FlatError` trait
19 Flat,
20
21 /// The entire error stack is going to be made available using `serde`
22 Full,
23}