Module binary_layout::prelude[][src]

Expand description

Import this to get everything into scope that you need for defining and using layouts.

Example

use binary_layout::prelude::*;

Re-exports

pub use crate::define_layout;

Traits

A field represents one of the fields in the data layout and offers accessors for it. It remembers the offset of the field in its const generic parameter and the accessors use that to access the field.

This trait is implemented for fields with “copy access”, i.e. fields that read/write data by copying it from/to the binary blob. Examples of this are primitive types like u8, i32, …

This trait is implemented for fields with “slice access”, i.e. fields that are read/write directly without a copy by returning a borrowed slice to the underlying data.

This trait offers access to the metadata of a sized field in a layout. Sized fields are all fields with a defined size. This is almost all fields. The only exception is an unsized array field that can be used to match tail data, i.e. any data at the end of the storage after all other fields were defined and until the storage ends.