[][src]Crate typelayout

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

pub extern crate typenum;
pub extern crate frunk;
pub use frunk::Generic;

Traits

FromZeros

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