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 zero-bit fields are rejected at compile time.
// A field with zero bits makes no sense and should be caught early.

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

#[derive(BeBytes, Debug, PartialEq)]
struct ZeroBits {
    #[bits(8)]
    valid: u8,
    // Error: Zero bits is not allowed
    #[bits(0)]
    invalid: u8,
}

fn main() {}