fixed_num/
lib.rs

1//! <style>
2//!   table {
3//!     --border-color: var(--main-background-color)
4//!   }
5//! </style>
6//!
7//! <style>
8//!   .benchmark-table td:nth-child(2),
9//!   .benchmark-table th:nth-child(2),
10//!   .benchmark-table td:nth-child(3),
11//!   .benchmark-table th:nth-child(3) {
12//!     border-right: 4px solid var(--border-color)
13//!   }
14//! </style>
15#![doc = include_str!("../README.md")]
16#![cfg_attr(nightly, feature(const_trait_impl))]
17#![cfg_attr(nightly, feature(step_trait))]
18
19
20#[allow(unused_extern_crates)]
21extern crate self as fixed_num;
22
23pub mod ops;
24pub mod dec19x19;
25pub mod i128_ops;
26mod serde;
27
28pub use dec19x19::Dec19x19;
29
30// ==============
31// === Traits ===
32// ==============
33
34pub mod traits {
35    pub use crate::ops::traits::*;
36    pub use fixed_num_helper::Rand as _;
37}
38pub use traits::*;
39
40// =================
41// === UnwrapAll ===
42// =================
43
44pub trait UnwrapAll {
45    type Output;
46    fn unwrap_all(self) -> Self::Output;
47}
48
49impl<T> UnwrapAll for Option<T> {
50    type Output = T;
51    fn unwrap_all(self) -> Self::Output {
52        #[expect(clippy::unwrap_used)]
53        self.unwrap()
54    }
55}
56
57impl UnwrapAll for Dec19x19 {
58    type Output = Self;
59    fn unwrap_all(self) -> Self::Output {
60        self
61    }
62}