bebytes 3.0.2

A Rust library for serialization and deserialization of network structs.
Documentation
use bebytes::BeBytes;

#[derive(Debug, Clone, PartialEq, BeBytes)]
struct MultipleMarkers {
    #[UntilMarker(0x7F)]
    first: Vec<u8>,
    #[UntilMarker(0xFF)]
    second: Vec<u8>,
    final_byte: u8,
}

#[test]
fn debug_multiple_markers() {
    let msg = MultipleMarkers {
        first: vec![0x10, 0x20],
        second: vec![0x30, 0x40, 0x50],
        final_byte: 0x99,
    };

    let bytes = msg.to_be_bytes();

    println!("Generated bytes: {:02X?}", bytes);
    println!("Bytes length: {}", bytes.len());

    for (i, &b) in bytes.iter().enumerate() {
        println!("  [{}]: 0x{:02X}", i, b);
    }

    // The structure should be:
    // first data: 0x10, 0x20
    // first marker: 0x7F
    // second data: 0x30, 0x40, 0x50
    // second marker: 0xFF
    // final byte: 0x99
    // Total: 2 + 1 + 3 + 1 + 1 = 8 bytes

    // Actually the total is 8, not 9! My test was wrong
    assert_eq!(bytes.len(), 8);
}