safe_bigmath/lib.rs
1#![cfg_attr(not(feature = "std"), no_std)]
2#![deny(missing_docs)]
3//! Safe, non-panicking numeric primitives built on top of pure-Rust `num-bigint` (alloc-only).
4//!
5//! `std` support is enabled by default; disable default features to use `no_std` + `alloc`.
6//!
7//! `SafeInt` and `SafeDec` implement `lencode::Encode`/`Decode`. The wire format uses a
8//! compact, little-endian varint header for values with up to 63 payload bytes, and
9//! falls back to lencode's `Vec<u8>` encoding for larger magnitudes.
10
11extern crate alloc;
12
13#[cfg(any(test, feature = "std"))]
14extern crate std;
15
16/// Fixed-precision decimal support built on `SafeInt`.
17pub mod decimal;
18/// Arbitrary-precision integer support and helpers.
19pub mod integer;
20/// Parsers for `SafeInt` and `SafeDec` literals.
21pub mod parsing;
22
23/// Re-export of the fixed-precision decimal type.
24pub use decimal::SafeDec;
25/// Re-export of the arbitrary-precision integer type.
26pub use integer::SafeInt;