bebytes 3.0.2

A Rust library for serialization and deserialization of network structs.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// This test verifies that circular dependencies in size expressions
// are detected and produce a compile-time error.

use bebytes::BeBytes;
#[cfg(not(feature = "std"))]
extern crate alloc;

#[derive(BeBytes, Debug, PartialEq)]
struct CircularDependency {
    // Error: field1 depends on field2, which depends on field1
    #[bebytes(size = "field2")]
    field1: Vec<u8>,
    #[bebytes(size = "field1")]
    field2: Vec<u8>,
}

fn main() {}