Skip to content

Commit 804ef57

Browse files
committed
misc: improved macro documentation
1 parent 277849f commit 804ef57

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

raw_struct_derive/src/lib.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@ mod derive_raw_struct;
66
/// Marks a struct as a representation of a C-style struct with memory-mapped fields.
77
///
88
/// # Supported Attributes:
9-
/// - `size = "<struct size>"` (required)
10-
/// Defines the total memory size of the struct.
9+
/// - `size = "<struct size>"`
10+
/// Defines the total memory size of the struct.
11+
/// Structs attributed with size will implement the `SizedViewable` trait and be `Copy`able.
12+
///
13+
/// - `resolver = "my_resolver_fn"`
14+
/// Define a custom offset resolver where the raw field attribute value of `offset` will be passed into.
15+
/// This allows a relaxiation of the `offset` value of the field as it may be anything. The function must return an u64.
16+
/// By default the resolver is `core::convert::identity`.
1117
///
1218
/// Each field within the struct must be annotated with the `#[field(...)]` attribute.
1319
///

0 commit comments

Comments
 (0)