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;
26
27pub use dec19x19::Dec19x19;
28
29// ==============
30// === Traits ===
31// ==============
32
33pub mod traits {
34    pub use crate::ops::*;
35    pub use fixed_num_helper::Rand;
36}
37pub use traits::*;
38
39// =================
40// === UnwrapAll ===
41// =================
42
43pub trait UnwrapAll {
44    type Output;
45    fn unwrap_all(self) -> Self::Output;
46}
47
48impl<T> UnwrapAll for Option<T> {
49    type Output = T;
50    fn unwrap_all(self) -> Self::Output {
51        #[expect(clippy::unwrap_used)]
52        self.unwrap()
53    }
54}
55
56impl UnwrapAll for Dec19x19 {
57    type Output = Self;
58    fn unwrap_all(self) -> Self::Output {
59        self
60    }
61}