smallint/lib.rs
1#![deny(missing_docs)]
2#![warn(clippy::all)]
3
4//! A crate for small integer optimization. Provides the [`SmallInt`] type. When possible this will
5//! inline an integer and store it on the stack if that integer is small. However, for larger values,
6//! this will be instead stored on the heap as a pointer to a `u32` slice, a length, and a sign.
7
8// Invariant: If a small integer is within the bounds of an inline value, it must be inline.
9// Invariant: If a small integer is on the heap, the size is the minimum digits required to
10// represent it.
11
12mod smallint;
13
14pub use crate::smallint::SmallInt;
15pub use crate::smallint::SmallUint;
16
17mod error;
18
19pub use error::SmallIntError;
20
21mod convert;
22mod ord;
23
24mod logic;
25mod ops;
26
27mod bigint;
28
29mod pretty;
30
31mod tests;