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
//! This is internal component (procedural macro implementation) of
//! [`typed_grid`](https://crates.io/crates/typed_grid).
use GridArgs;
use TokenStream;
use parse_macro_input;
/// Generates types for grid navigation.
///
/// ```rust,ignore
/// use typed_grid_macro::*;
///
/// typed_grid!(2, 2);
///
/// impl Moved for i32 {
/// fn moved(&mut self, p: Position) {
/// *self += 1;
/// println!("MOVED: {p:?} {self}")
/// }
/// }
/// ```
/// Generates types for grid navigation with extension methods.
///
/// ```rust,ignore
/// use typed_grid_macro::*;
///
/// typed_grid_ext!(2, 2);
///
/// impl Moved for i32 {
/// fn moved(&mut self, p: Position) {
/// *self += 1;
/// println!("MOVED: {p:?} {self}")
/// }
/// }
/// ```