[][src]Crate buffering

Approach

This crate is meant to provide a macro which behaves as follows:

  • The provided macro uses a more restrictive approach. It uses procedural macros and unions to provide some level of safety when writing to fields in a struct while allowing the underlying struct to be interpreted as a slice. This is a C-like workflow but does provide some helpful guarantees that come with Rust like protection against buffer overflows and bounds checking. One very important note is that structs that use the provided procedural macro must be completely stack allocated. Compilation will fail if certain constructs that prevent size computation at compile time are used. As a result this really should only be used as a Rust substitute with some additional safety for the common C workflow when doing things like parsing network packets.

Derive Macros

NoCopy

Procedural macro that will derive getters and setters with appropriate endianness for every field defined in the struct