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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/// Macro to delegate methods to a specified field
///
/// This macro generates methods that delegate to methods on a field of the struct.
/// Each delegated method will call the corresponding method on the specified field
/// and return `self` for method chaining.
///
/// # Example
///
/// ```rust,ignore
/// use docx_rs::delegate_to_field;
///
/// struct Wrapper {
/// inner: SomeType,
/// }
///
/// impl Wrapper {
/// delegate_to_field! {
/// inner =>
/// method1(param: i32) -> Self,
/// method2(a: String, b: bool) -> Self,
/// method3() -> Self,
/// }
/// }
/// ```
)*
};
}
/// Macro to delegate getter methods to a specified field
///
/// This macro generates getter methods that delegate to methods on a field of the struct.
/// Each delegated method will call the corresponding method on the specified field
/// and return the result directly.
///
/// # Example
///
/// ```rust,ignore
/// use docx_rs::delegate_getters_to_field;
///
/// struct Wrapper {
/// inner: SomeType,
/// }
///
/// impl Wrapper {
/// delegate_getters_to_field! {
/// inner =>
/// get_value() -> i32,
/// get_name() -> String,
/// is_active() -> bool,
/// }
/// }
/// ```
)*
};
}