ext_ops/
lib.rs

1/*
2 * Copyright (c) 2023 Martin Mills <daggerbot@gmail.com>
3 *
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 */
8
9#![cfg_attr(not(feature = "std"), no_std)]
10
11///! General purpose arithmetic operator traits which are missing from the standard library.
12
13mod error;
14mod saturating_ops;
15mod try_ops;
16mod wrapping_ops;
17
18pub use error::{
19    ArithmeticError,
20    Overflow,
21    RangeError,
22    Undefined,
23    Underflow,
24};
25pub use saturating_ops::{
26    SaturatingAdd,
27    SaturatingMul,
28    SaturatingNeg,
29    SaturatingSub,
30};
31pub use try_ops::{
32    TryAdd,
33    TryDiv,
34    TryMul,
35    TryNeg,
36    TryRem,
37    TrySub,
38};
39pub use wrapping_ops::{
40    WrappingAdd,
41    WrappingMul,
42    WrappingNeg,
43    WrappingSub,
44};