pub struct Nat(/* private fields */);Expand description
A Lean Nat: a natural number of arbitrary precision.
The arithmetic follows Lean: subtraction truncates at zero, division by zero is zero and the remainder of a division by zero is the dividend.
Implementations§
Trait Implementations§
impl Eq for Nat
Source§impl Ord for Nat
impl Ord for Nat
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Nat
impl PartialOrd for Nat
impl StructuralPartialEq for Nat
Source§impl TryFrom<&Nat> for u8
impl TryFrom<&Nat> for u8
Source§type Error = OutOfRange
type Error = OutOfRange
The type returned in the event of a conversion error.
Source§impl TryFrom<&Nat> for u16
impl TryFrom<&Nat> for u16
Source§type Error = OutOfRange
type Error = OutOfRange
The type returned in the event of a conversion error.
Source§impl TryFrom<&Nat> for u32
impl TryFrom<&Nat> for u32
Source§type Error = OutOfRange
type Error = OutOfRange
The type returned in the event of a conversion error.
Source§impl TryFrom<&Nat> for u64
impl TryFrom<&Nat> for u64
Source§type Error = OutOfRange
type Error = OutOfRange
The type returned in the event of a conversion error.
Source§impl TryFrom<&Nat> for u128
impl TryFrom<&Nat> for u128
Source§type Error = OutOfRange
type Error = OutOfRange
The type returned in the event of a conversion error.
Source§impl TryFrom<&Nat> for usize
impl TryFrom<&Nat> for usize
Source§type Error = OutOfRange
type Error = OutOfRange
The type returned in the event of a conversion error.
Source§impl TryFrom<Int> for Nat
impl TryFrom<Int> for Nat
Source§type Error = OutOfRange
type Error = OutOfRange
The type returned in the event of a conversion error.
Source§impl TryFrom<Nat> for u8
impl TryFrom<Nat> for u8
Source§type Error = OutOfRange
type Error = OutOfRange
The type returned in the event of a conversion error.
Source§impl TryFrom<Nat> for u16
impl TryFrom<Nat> for u16
Source§type Error = OutOfRange
type Error = OutOfRange
The type returned in the event of a conversion error.
Source§impl TryFrom<Nat> for u32
impl TryFrom<Nat> for u32
Source§type Error = OutOfRange
type Error = OutOfRange
The type returned in the event of a conversion error.
Source§impl TryFrom<Nat> for u64
impl TryFrom<Nat> for u64
Source§type Error = OutOfRange
type Error = OutOfRange
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Forget for Nat
impl Freeze for Nat
impl Move for Nat
impl RefUnwindSafe for Nat
impl Send for Nat
impl Sync for Nat
impl Unpin for Nat
impl UnsafeUnpin for Nat
impl UnwindSafe for Nat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more