#[non_exhaustive]pub enum AllIntegers {
Integer(Integers),
NonZero(NonZeroIntegers),
Positive(PositiveIntegers),
NonNegative(NonNegativeIntegers),
Negative(NegativeIntegers),
NonPositive(NonPositiveIntegers),
Prime(Primes),
}Expand description
The family of all kinds of integers, also known as AllZ.
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.
Integer(Integers)
NonZero(NonZeroIntegers)
Positive(PositiveIntegers)
NonNegative(NonNegativeIntegers)
Negative(NegativeIntegers)
NonPositive(NonPositiveIntegers)
Prime(Primes)
Trait Implementations§
Source§impl Bound for AllIntegers
This implementation defers to the actual integer variant.
impl Bound for AllIntegers
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 AllIntegers
impl Clone for AllIntegers
Source§fn clone(&self) -> AllIntegers
fn clone(&self) -> AllIntegers
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 Count for AllIntegers
impl Count for AllIntegers
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 AllIntegers
This implementation defers to the actual integer variant.
impl Countable for AllIntegers
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 AllIntegers
impl Debug for AllIntegers
Source§impl<N: Number> From<AllIntegers> for AllNumbers<N>
impl<N: Number> From<AllIntegers> for AllNumbers<N>
Source§fn from(n: AllIntegers) -> AllNumbers<N>
fn from(n: AllIntegers) -> AllNumbers<N>
Converts to this type from the input type.
Source§impl From<Integers> for AllIntegers
impl From<Integers> for AllIntegers
Source§fn from(z: Integers) -> AllIntegers
fn from(z: Integers) -> AllIntegers
Converts to this type from the input type.
Source§impl From<NegativeIntegers> for AllIntegers
impl From<NegativeIntegers> for AllIntegers
Source§fn from(z: NegativeIntegers) -> AllIntegers
fn from(z: NegativeIntegers) -> AllIntegers
Converts to this type from the input type.
Source§impl From<NonNegativeIntegers> for AllIntegers
impl From<NonNegativeIntegers> for AllIntegers
Source§fn from(z: NonNegativeIntegers) -> AllIntegers
fn from(z: NonNegativeIntegers) -> AllIntegers
Converts to this type from the input type.
Source§impl From<NonPositiveIntegers> for AllIntegers
impl From<NonPositiveIntegers> for AllIntegers
Source§fn from(z: NonPositiveIntegers) -> AllIntegers
fn from(z: NonPositiveIntegers) -> AllIntegers
Converts to this type from the input type.
Source§impl From<NonZeroIntegers> for AllIntegers
impl From<NonZeroIntegers> for AllIntegers
Source§fn from(z: NonZeroIntegers) -> AllIntegers
fn from(z: NonZeroIntegers) -> AllIntegers
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 From<Primes> for AllIntegers
impl From<Primes> for AllIntegers
Source§fn from(z: Primes) -> AllIntegers
fn from(z: Primes) -> AllIntegers
Converts to this type from the input type.
Source§impl Ident for AllIntegers
This implementation defers to the actual integer variant.
impl Ident for AllIntegers
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 Number for AllIntegers
This implementation is no-op.
impl Number for AllIntegers
This implementation is no-op.
Source§type InnerRepr = AllIntegers
type InnerRepr = AllIntegers
The inner primitive representation of the number. Read more
Source§type InnermostRepr = AllIntegers
type InnermostRepr = AllIntegers
The innermost primitive representation of the number. Read more
Source§fn from_inner_repr(value: AllIntegers) -> NumeraResult<Self>
fn from_inner_repr(value: AllIntegers) -> NumeraResult<Self>
Forms a new number from its given
inner representation. Read moreSource§unsafe fn from_inner_repr_unchecked(value: AllIntegers) -> Self
unsafe fn from_inner_repr_unchecked(value: AllIntegers) -> Self
Available on crate feature
not(safe) only.Forms a new number from its given
inner representation. Read moreSource§fn from_innermost_repr(value: AllIntegers) -> NumeraResult<Self>
fn from_innermost_repr(value: AllIntegers) -> NumeraResult<Self>
Forms a new number from its
innermost representation. Read moreSource§unsafe fn from_innermost_repr_unchecked(value: AllIntegers) -> Self
unsafe fn from_innermost_repr_unchecked(value: AllIntegers) -> Self
Available on crate feature
not(safe) only.Forms a new number from its
innermost representation. Read moreSource§fn into_inner_repr(self) -> Self::InnerRepr
fn into_inner_repr(self) -> Self::InnerRepr
Deconstructs the number to its inner representation.
Source§fn into_innermost_repr(self) -> Self::InnermostRepr
fn into_innermost_repr(self) -> Self::InnermostRepr
Deconstructs the number to its innermost representation.
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 PartialEq for AllIntegers
impl PartialEq for AllIntegers
Source§impl Sign for AllIntegers
This implementation defers to the actual integer variant.
impl Sign for AllIntegers
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 Integers
impl TryFrom<AllIntegers> for Integers
Source§impl TryFrom<AllIntegers> for NegativeIntegers
impl TryFrom<AllIntegers> for NegativeIntegers
Source§type Error = NumeraErrors
type Error = NumeraErrors
The type returned in the event of a conversion error.
Source§fn try_from(z: AllIntegers) -> Result<NegativeIntegers, Self::Error>
fn try_from(z: AllIntegers) -> Result<NegativeIntegers, Self::Error>
Performs the conversion.
Source§impl TryFrom<AllIntegers> for NonNegativeIntegers
impl TryFrom<AllIntegers> for NonNegativeIntegers
Source§type Error = NumeraErrors
type Error = NumeraErrors
The type returned in the event of a conversion error.
Source§fn try_from(z: AllIntegers) -> Result<NonNegativeIntegers, Self::Error>
fn try_from(z: AllIntegers) -> Result<NonNegativeIntegers, Self::Error>
Performs the conversion.
Source§impl TryFrom<AllIntegers> for NonPositiveIntegers
impl TryFrom<AllIntegers> for NonPositiveIntegers
Source§type Error = NumeraErrors
type Error = NumeraErrors
The type returned in the event of a conversion error.
Source§fn try_from(z: AllIntegers) -> Result<NonPositiveIntegers, Self::Error>
fn try_from(z: AllIntegers) -> Result<NonPositiveIntegers, Self::Error>
Performs the conversion.
Source§impl TryFrom<AllIntegers> for NonZeroIntegers
impl TryFrom<AllIntegers> for NonZeroIntegers
Source§type Error = NumeraErrors
type Error = NumeraErrors
The type returned in the event of a conversion error.
Source§fn try_from(z: AllIntegers) -> Result<NonZeroIntegers, Self::Error>
fn try_from(z: AllIntegers) -> Result<NonZeroIntegers, Self::Error>
Performs the conversion.
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<AllIntegers> for Primes
impl TryFrom<AllIntegers> for Primes
Source§impl<N: Number> TryFrom<AllNumbers<N>> for AllIntegers
impl<N: Number> TryFrom<AllNumbers<N>> for AllIntegers
Source§type Error = NumeraErrors
type Error = NumeraErrors
The type returned in the event of a conversion error.
Source§fn try_from(n: AllNumbers<N>) -> Result<AllIntegers, Self::Error>
fn try_from(n: AllNumbers<N>) -> Result<AllIntegers, Self::Error>
Performs the conversion.
impl Eq for AllIntegers
impl StructuralPartialEq for AllIntegers
Auto Trait Implementations§
impl Freeze for AllIntegers
impl RefUnwindSafe for AllIntegers
impl Send for AllIntegers
impl Sync for AllIntegers
impl Unpin for AllIntegers
impl UnwindSafe for AllIntegers
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.