Trait flatdata::Struct[][src]

pub trait Struct: Debug {
    const SIZE_IN_BYTES: usize;
    const IS_OVERLAPPING_WITH_NEXT: bool;

    unsafe fn create_unchecked() -> Self;
}
Expand description

A factory trait used to bind lifetime to Ref implementations.

Vector/ArrayView-like classes cannot be directly implemented over the structs since that binds lifetime too early. Instead this generic factory and Higher-Rank-Trait-Bounds are used to emulate higher-kinded-generics.

Associated Constants

Size of an object of this type in bytes.

Whether this structs requires data of the next instance

Required methods

Create a new struct

Safety

If the struct is not self-contained (NoOverlap), and there is no directly subsequent structure in memory, then the resulting instance’s data must not be accessed

Implementors