macro_rules! derive_adhoc_template_Flattenable { ( { $($driver:tt)* } $([$($aoptions:tt)*])? { $($future:tt)* } $($dpassthrough:tt)* ) => { ... }; ($($wrong:tt)*) => { ... }; }
Expand description
Derives Flattenable
for a struct
Limitations
Some serde attributes might not be supported. For example, ones which make the type no longer deserialize as a named fields struct. This will be detected by a macro-generated always-failing test case.
Most serde attributes (eg field renaming and ignoring) will be fine.
Example
use serde::{Serialize, Deserialize};
use derive_adhoc::Adhoc;
use tor_config::derive_adhoc_template_Flattenable;
#[derive(Serialize, Deserialize, Debug, Adhoc)]
#[derive_adhoc(Flattenable)]
struct A {
a: i32,
}
This is a derive_adhoc
template. Do not invoke it directly.
To use it, write: #[derive(Adhoc)] #[derive_adhoc(Flattenable)]
.