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
// This test verifies that referencing a non-existent field in a size expression
// produces a clear compile-time error.

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

#[derive(BeBytes, Debug, PartialEq)]
struct InvalidSizeRef {
    length: u16,
    // Error: 'nonexistent' field doesn't exist
    #[bebytes(size = "nonexistent")]
    data: Vec<u8>,
}

fn main() {}