1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
use TokenStream;
use parse_macro_input;
/// Derive a `Valuable` implementation for a struct or enum.
///
/// # Attributes
///
/// ## `#[valuable(rename = "...")]`
///
/// Use the given name instead of its Rust name.
///
/// ## `#[valuable(transparent)]`
///
/// Delegate the trait implementation to the field.
///
/// This attribute can only be used on a struct that has a single field.
///
/// ## `#[valuable(skip)]`
///
/// Skip the field.
///
/// # Examples
///
/// ```
/// use valuable::Valuable;
///
/// #[derive(Valuable)]
/// struct HelloWorld {
/// message: Message,
/// }
///
/// #[derive(Valuable)]
/// enum Message {
/// HelloWorld,
/// Custom(String),
/// }
/// ```