1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
//! Type-level layout information. //! ## Example //! ```rust //! 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); //! ``` pub extern crate typenum; pub extern crate frunk; extern crate frunk_core; mod align; use crate::align::*; mod data; mod layout; pub use crate::layout::Layout; mod packing; use crate::packing::*; mod padding; pub use padding::NoPadding; mod size; use crate::size::*; pub use frunk::Generic; mod fromzeros; pub use fromzeros::FromZeros; /// A marker trait for types that are ReprC pub unsafe trait ReprC {}