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
18
// This test verifies that #[bits] attribute cannot be used on non-numeric types.
// Bit fields only make sense for integer types.

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

#[derive(BeBytes, Debug, PartialEq)]
struct BitsOnNonNumeric {
    valid: u8,
    // Error: Cannot use #[bits] on String type
    #[bits(4)]
    invalid: String,
    #[bits(4)]
    padding: u8,
}

fn main() {}