Expand description
Field trait and implementations for zero-copy field access.
This module provides the abstraction for reading and writing protocol fields directly from/to raw packet buffers at specific offsets.
Structs§
- Bytes
Field - A variable-length byte field
- Field
Desc - Describes a field’s position and type within a protocol header.
- MacAddress
- A 6-byte MAC address with display and parsing support.
Enums§
- Field
Error - Errors that can occur during field operations.
- Field
Type - Supported field types for dynamic access.
- Field
Value - A dynamically-typed field value.
Traits§
- Field
- Trait for reading/writing protocol fields from raw buffers.
Functions§
- read_
bits_ be - Read arbitrary number of bits from a byte buffer at a bit offset.
bit_offsetis the starting bit position (0 = MSB of first byte).num_bitsis 1..=64. Returns the value right-aligned in a u64. - read_
bits_ le - Read bits in little-endian bit order (LSB of first byte = bit 0).
- read_i8
- read_
i16_ be - read_
i32_ be - read_
i64_ be - read_
u16_ le - read_
u24_ be - read_
u24_ le - read_
u32_ le - read_
u64_ le - write_
bits_ be - Write arbitrary number of bits to a byte buffer at a bit offset.
bit_offsetis the starting bit position (0 = MSB of first byte).num_bitsis 1..=64.valueis right-aligned. - write_
bits_ le - Write bits in little-endian bit order (LSB of first byte = bit 0).
- write_
i8 - write_
i16_ be - write_
i32_ be - write_
i64_ be - write_
u16_ le - write_
u24_ be - write_
u24_ le - write_
u32_ le - write_
u64_ le