Expand description
Type-level layout information.
§Example
use typelayout::{ReprC, Generic, Layout};
#[derive(Generic)]
#[repr(C)]
pub struct Struct {
first: u8,
second: u32,
}
unsafe impl ReprC for Struct {}
assert_eq!(4, <Struct as Layout>::ALIGN);
assert_eq!(8, <Struct as Layout>::SIZE);
Re-exports§
Traits§
- From
Zeros - Working Example
- Generic
- A trait that converts from a type to a generic representation.
- Layout
- The layout of a type.
- NoPadding
- Marker trait for types without any padding bytes.
- ReprC
- A marker trait for types that are ReprC
Derive Macros§
- Generic
- Derives a Generic instance based on HList for a given Struct or Tuple Struct