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
/*!
Big array helper for serde.
The purpose of this crate is to make (de-)serializing arrays of sizes > 32 easy.
This solution is needed until [serde adopts const generics support](https://github.com/serde-rs/serde/issues/1937).
## Example
```
extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate serde_json;
extern crate serde_big_array;
use serde_big_array::BigArray;
#[derive(Serialize, Deserialize)]
struct S {
#[serde(with = "BigArray")]
arr: [u8; 64],
}
#[test]
fn test() {
let s = S { arr: [1; 64] };
let j = serde_json::to_string(&s).unwrap();
let s_back = serde_json::from_str::<S>(&j).unwrap();
assert!(&s.arr[..] == &s_back.arr[..]);
assert!(false);
}
# fn main() {}
```
*/
pub use BigArray;
/**
Big array macro
The macro exists for legacy reasons, to make moving to the pure `const-generics` mode easier.
Instead of this macro, please use the [`BigArray`] trait directly.
*/