Crate data_models

Source
Expand description

A data model is the choices of bit width of integer types by each platform.

This library is used to lookup the sizes of various C-types of a data model.

§Examples

use data_models::*;
let model = DataModel::LP64; // e.g. Linux
let p = model.size_of::<Pointer>();
assert_eq!(p, 8);

Enums§

Char
Char represents the char C type. Smallest addressable unit of the machine. It contains CHAR_BIT bits (typically 8).
DataModel
A data model is the choices of bit width of integer types by each platform.
Int
Int represents the int C type. It is required to be at least 16-bits.
Long
Long represents the long C type. It is required to be at least 32-bits.
LongLong
LongLong represents the long long C type. It is required to be at least 64-bits.
Pointer
Pointer represents the size_t C type. It is required to be at least 16-bits.
Short
Short represents the short C type. It is required to be at least 16-bits.