#[non_exhaustive]pub enum PositiveIntegers {
_8(PositiveInteger8),
_16(PositiveInteger16),
_32(PositiveInteger32),
_64(PositiveInteger64),
_128(PositiveInteger128),
}Expand description
The family of positive integers, also known as Pz.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
_8(PositiveInteger8)
_16(PositiveInteger16)
_32(PositiveInteger32)
_64(PositiveInteger64)
_128(PositiveInteger128)
Trait Implementations§
Source§impl Bound for PositiveIntegers
This implementation defers to the actual integer variant.
impl Bound for PositiveIntegers
This implementation defers to the actual integer variant.
Source§fn is_lower_bounded(&self) -> bool
fn is_lower_bounded(&self) -> bool
Returns true if the number is lower bounded.
Source§fn is_upper_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
Returns true if the number is upper bounded.
Source§fn lower_bound(&self) -> Option<Self>
fn lower_bound(&self) -> Option<Self>
Returns the lower bound, if any.
Source§fn upper_bound(&self) -> Option<Self>
fn upper_bound(&self) -> Option<Self>
Returns the upper bound, if any.
Source§impl Clone for PositiveIntegers
impl Clone for PositiveIntegers
Source§fn clone(&self) -> PositiveIntegers
fn clone(&self) -> PositiveIntegers
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ConstLowerBounded for PositiveIntegers
impl ConstLowerBounded for PositiveIntegers
Source§const MIN: Self
const MIN: Self
Returns a PositiveInteger8::MIN.
Source§impl ConstOne for PositiveIntegers
impl ConstOne for PositiveIntegers
Source§const ONE: Self
const ONE: Self
Returns a PositiveInteger8::ONE.
Source§impl ConstUpperBounded for PositiveIntegers
impl ConstUpperBounded for PositiveIntegers
Source§const MAX: Self
const MAX: Self
Returns a PositiveInteger128::MAX.
Source§impl Count for PositiveIntegers
impl Count for PositiveIntegers
Source§fn is_countable(&self) -> bool
fn is_countable(&self) -> bool
All integers are countable.
Source§fn is_uncountable(&self) -> bool
fn is_uncountable(&self) -> bool
Returns
false if the number is countable.Source§impl Countable for PositiveIntegers
This implementation defers to the actual integer variant.
impl Countable for PositiveIntegers
This implementation defers to the actual integer variant.
Source§fn next(&self) -> NumeraResult<Self>
fn next(&self) -> NumeraResult<Self>
Returns the next countable value. Read more
Source§fn previous(&self) -> NumeraResult<Self>
fn previous(&self) -> NumeraResult<Self>
Returns the previous countable value. Read more
Source§impl Debug for PositiveIntegers
impl Debug for PositiveIntegers
Source§impl From<PositiveInteger128> for PositiveIntegers
impl From<PositiveInteger128> for PositiveIntegers
Source§fn from(z: PositiveInteger128) -> PositiveIntegers
fn from(z: PositiveInteger128) -> PositiveIntegers
Converts to this type from the input type.
Source§impl From<PositiveInteger16> for PositiveIntegers
impl From<PositiveInteger16> for PositiveIntegers
Source§fn from(z: PositiveInteger16) -> PositiveIntegers
fn from(z: PositiveInteger16) -> PositiveIntegers
Converts to this type from the input type.
Source§impl From<PositiveInteger32> for PositiveIntegers
impl From<PositiveInteger32> for PositiveIntegers
Source§fn from(z: PositiveInteger32) -> PositiveIntegers
fn from(z: PositiveInteger32) -> PositiveIntegers
Converts to this type from the input type.
Source§impl From<PositiveInteger64> for PositiveIntegers
impl From<PositiveInteger64> for PositiveIntegers
Source§fn from(z: PositiveInteger64) -> PositiveIntegers
fn from(z: PositiveInteger64) -> PositiveIntegers
Converts to this type from the input type.
Source§impl From<PositiveInteger8> for PositiveIntegers
impl From<PositiveInteger8> for PositiveIntegers
Source§fn from(z: PositiveInteger8) -> PositiveIntegers
fn from(z: PositiveInteger8) -> PositiveIntegers
Converts to this type from the input type.
Source§impl From<PositiveIntegers> for AllIntegers
impl From<PositiveIntegers> for AllIntegers
Source§fn from(z: PositiveIntegers) -> AllIntegers
fn from(z: PositiveIntegers) -> AllIntegers
Converts to this type from the input type.
Source§impl Ident for PositiveIntegers
This implementation defers to the actual integer variant.
impl Ident for PositiveIntegers
This implementation defers to the actual integer variant.
Source§fn can_neg_one(&self) -> bool
fn can_neg_one(&self) -> bool
Returns
true if the number can represent -1,
the additive inverse of the multiplicative identity. Read moreSource§fn is_neg_one(&self) -> bool
fn is_neg_one(&self) -> bool
Returns
true if the current value is -1,
the additive inverse of the multiplicative identity.Source§impl LowerBounded for PositiveIntegers
impl LowerBounded for PositiveIntegers
Source§fn new_min() -> Self
fn new_min() -> Self
Returns a PositiveInteger8::new_min().
Source§impl Number for PositiveIntegers
This implementation is no-op.
impl Number for PositiveIntegers
This implementation is no-op.
Source§fn from_inner_repr(value: PositiveIntegers) -> NumeraResult<Self>
fn from_inner_repr(value: PositiveIntegers) -> NumeraResult<Self>
Source§unsafe fn from_inner_repr_unchecked(value: PositiveIntegers) -> Self
Available on crate feature not(safe) only.
unsafe fn from_inner_repr_unchecked(value: PositiveIntegers) -> Self
not(safe) only.Source§fn from_innermost_repr(value: PositiveIntegers) -> NumeraResult<Self>
fn from_innermost_repr(value: PositiveIntegers) -> NumeraResult<Self>
Source§unsafe fn from_innermost_repr_unchecked(value: PositiveIntegers) -> Self
Available on crate feature not(safe) only.
unsafe fn from_innermost_repr_unchecked(value: PositiveIntegers) -> Self
not(safe) only.Source§fn into_inner_repr(self) -> Self::InnerRepr
fn into_inner_repr(self) -> Self::InnerRepr
Returns self.
Source§fn into_innermost_repr(self) -> Self::InnermostRepr
fn into_innermost_repr(self) -> Self::InnermostRepr
Returns self.
Source§type InnerRepr = PositiveIntegers
type InnerRepr = PositiveIntegers
The inner primitive representation of the number. Read more
Source§type InnermostRepr = PositiveIntegers
type InnermostRepr = PositiveIntegers
The innermost primitive representation of the number. Read more
Source§fn try_from_inner_repr(inner: impl Into<Self::InnerRepr>) -> NumeraResult<Self>where
Self: Sized,
fn try_from_inner_repr(inner: impl Into<Self::InnerRepr>) -> NumeraResult<Self>where
Self: Sized,
Forms a new number from its converted given
inner representation. Read moreSource§impl One for PositiveIntegers
impl One for PositiveIntegers
Source§impl PartialEq for PositiveIntegers
impl PartialEq for PositiveIntegers
Source§impl Sign for PositiveIntegers
This implementation defers to the actual integer variant.
impl Sign for PositiveIntegers
This implementation defers to the actual integer variant.
Source§fn can_positive(&self) -> bool
fn can_positive(&self) -> bool
Returns
true if the type can represent positive numbers.Source§fn can_negative(&self) -> bool
fn can_negative(&self) -> bool
Returns
true if the type can represent negative numbers.Source§fn is_positive(&self) -> bool
fn is_positive(&self) -> bool
Returns
true if the value is positive (> 0).Source§fn is_negative(&self) -> bool
fn is_negative(&self) -> bool
Returns
true if the value is negative (< 0).Source§impl TryFrom<AllIntegers> for PositiveIntegers
impl TryFrom<AllIntegers> for PositiveIntegers
Source§type Error = NumeraErrors
type Error = NumeraErrors
The type returned in the event of a conversion error.
Source§fn try_from(z: AllIntegers) -> Result<PositiveIntegers, Self::Error>
fn try_from(z: AllIntegers) -> Result<PositiveIntegers, Self::Error>
Performs the conversion.
Source§impl TryFrom<PositiveIntegers> for PositiveInteger128
impl TryFrom<PositiveIntegers> for PositiveInteger128
Source§type Error = NumeraErrors
type Error = NumeraErrors
The type returned in the event of a conversion error.
Source§fn try_from(z: PositiveIntegers) -> Result<PositiveInteger128, Self::Error>
fn try_from(z: PositiveIntegers) -> Result<PositiveInteger128, Self::Error>
Performs the conversion.
Source§impl TryFrom<PositiveIntegers> for PositiveInteger16
impl TryFrom<PositiveIntegers> for PositiveInteger16
Source§type Error = NumeraErrors
type Error = NumeraErrors
The type returned in the event of a conversion error.
Source§fn try_from(z: PositiveIntegers) -> Result<PositiveInteger16, Self::Error>
fn try_from(z: PositiveIntegers) -> Result<PositiveInteger16, Self::Error>
Performs the conversion.
Source§impl TryFrom<PositiveIntegers> for PositiveInteger32
impl TryFrom<PositiveIntegers> for PositiveInteger32
Source§type Error = NumeraErrors
type Error = NumeraErrors
The type returned in the event of a conversion error.
Source§fn try_from(z: PositiveIntegers) -> Result<PositiveInteger32, Self::Error>
fn try_from(z: PositiveIntegers) -> Result<PositiveInteger32, Self::Error>
Performs the conversion.
Source§impl TryFrom<PositiveIntegers> for PositiveInteger64
impl TryFrom<PositiveIntegers> for PositiveInteger64
Source§type Error = NumeraErrors
type Error = NumeraErrors
The type returned in the event of a conversion error.
Source§fn try_from(z: PositiveIntegers) -> Result<PositiveInteger64, Self::Error>
fn try_from(z: PositiveIntegers) -> Result<PositiveInteger64, Self::Error>
Performs the conversion.
Source§impl TryFrom<PositiveIntegers> for PositiveInteger8
impl TryFrom<PositiveIntegers> for PositiveInteger8
Source§type Error = NumeraErrors
type Error = NumeraErrors
The type returned in the event of a conversion error.
Source§fn try_from(z: PositiveIntegers) -> Result<PositiveInteger8, Self::Error>
fn try_from(z: PositiveIntegers) -> Result<PositiveInteger8, Self::Error>
Performs the conversion.
Source§impl UpperBounded for PositiveIntegers
impl UpperBounded for PositiveIntegers
Source§fn new_max() -> Self
fn new_max() -> Self
Returns a PositiveInteger128::new_max().
impl Eq for PositiveIntegers
impl NonNegative for PositiveIntegers
impl NonZero for PositiveIntegers
impl Positive for PositiveIntegers
impl StructuralPartialEq for PositiveIntegers
Auto Trait Implementations§
impl Freeze for PositiveIntegers
impl RefUnwindSafe for PositiveIntegers
impl Send for PositiveIntegers
impl Sync for PositiveIntegers
impl Unpin for PositiveIntegers
impl UnwindSafe for PositiveIntegers
Blanket Implementations§
Source§impl<T> Also for T
impl<T> Also for T
Source§impl<T, Res> Apply<Res> for Twhere
T: ?Sized,
impl<T, Res> Apply<Res> for Twhere
T: ?Sized,
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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.