Struct NInt
pub struct NInt<U: Unsigned + NonZero> { /* private fields */ }
Type-level signed integers with negative sign.
Implementations
impl<U: Unsigned + NonZero> NInt<U>
fn new() -> NInt<U>Instantiates a singleton representing this strictly negative integer.
Trait Implementations
impl<Nl: Unsigned + NonZero, Nr: Cmp<Nl> + Unsigned + NonZero> Cmp<NInt<Nr>> for NInt<Nl>
type Output = <Nr as Cmp<Nl>>::Output;
impl<P: Unsigned + NonZero, N: Unsigned + NonZero> Cmp<PInt<P>> for NInt<N>
type Output = Less;
impl<U> Gcd<Z0> for NInt<U>
where
U: Unsigned + NonZero,
type Output = PInt<U>;
impl<U> Max<Z0> for NInt<U>
where
U: Unsigned + NonZero,
type Output = Z0;fn max(self, rhs: Z0) -> Self::Output
impl<U> Min<Z0> for NInt<U>
where
U: Unsigned + NonZero,
type Output = NInt<U>;fn min(self, Z0) -> Self::Output
impl<U> Mul<ATerm> for NInt<U>
where
U: Unsigned + NonZero,
type Output = ATerm;fn mul(self, ATerm) -> Self::Output
impl<U> ToInt<i16> for NInt<U>
where
U: Unsigned + NonZero,
fn to_int() -> i16const INT: i16 = Self::I16;
impl<U> ToInt<i32> for NInt<U>
where
U: Unsigned + NonZero,
fn to_int() -> i32const INT: i32 = Self::I32;
impl<U> ToInt<i64> for NInt<U>
where
U: Unsigned + NonZero,
fn to_int() -> i64const INT: i64 = Self::I64;
impl<U> ToInt<i8> for NInt<U>
where
U: Unsigned + NonZero,
fn to_int() -> i8const INT: i8 = Self::I8;
impl<U> ToInt<isize> for NInt<U>
where
U: Unsigned + NonZero,
fn to_int() -> isizeconst INT: isize = Self::ISIZE;
impl<U1, U2> Gcd<NInt<U2>> for NInt<U1>
where
U1: Unsigned + NonZero + Gcd<U2>,
U2: Unsigned + NonZero,
Gcf<U1, U2>: Unsigned + NonZero,
type Output = PInt<<U1 as Gcd<U2>>::Output>;
impl<U1, U2> Gcd<PInt<U2>> for NInt<U1>
where
U1: Unsigned + NonZero + Gcd<U2>,
U2: Unsigned + NonZero,
Gcf<U1, U2>: Unsigned + NonZero,
type Output = PInt<<U1 as Gcd<U2>>::Output>;
impl<U: Clone + Unsigned + NonZero> Clone for NInt<U>
fn clone(&self) -> Self
impl<U: Copy + Unsigned + NonZero> Copy for NInt<U>
impl<U: Debug + Unsigned + NonZero> Debug for NInt<U>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<U: Default + Unsigned + NonZero> Default for NInt<U>
fn default() -> Self
impl<U: Eq + Unsigned + NonZero> Eq for NInt<U>
impl<U: Hash + Unsigned + NonZero> Hash for NInt<U>
fn hash<__H: Hasher>(&self, state: &mut __H)
impl<U: Ord + Unsigned + NonZero> Ord for NInt<U>
fn cmp(&self, other: &Self) -> Ordering
impl<U: PartialEq + Unsigned + NonZero> PartialEq for NInt<U>
fn eq(&self, other: &Self) -> bool
impl<U: PartialEq + Unsigned + NonZero> StructuralPartialEq for NInt<U>
impl<U: PartialOrd + Unsigned + NonZero> PartialOrd for NInt<U>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
impl<U: Unsigned + NonZero + Binary> Binary for NInt<U>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<U: Unsigned + NonZero> Abs for NInt<U>
type Output = PInt<U>;
impl<U: Unsigned + NonZero> Add<Z0> for NInt<U>
type Output = NInt<U>;fn add(self, Z0) -> Self::Output
impl<U: Unsigned + NonZero> Cmp<Z0> for NInt<U>
type Output = Less;
impl<U: Unsigned + NonZero> Integer for NInt<U>
const I8: i8 = _;const I16: i16 = _;const I32: i32 = _;const I64: i64 = _;const ISIZE: isize = _;fn to_i8() -> i8fn to_i16() -> i16fn to_i32() -> i32fn to_i64() -> i64fn to_isize() -> isize
impl<U: Unsigned + NonZero> Mul<Z0> for NInt<U>
type Output = Z0;fn mul(self, Z0) -> Self::Output
impl<U: Unsigned + NonZero> Neg for NInt<U>
type Output = PInt<U>;fn neg(self) -> Self::Output
impl<U: Unsigned + NonZero> NonZero for NInt<U>
impl<U: Unsigned + NonZero> Pow<Z0> for NInt<U>
type Output = PInt<UInt<UTerm, B1>>;fn powi(self, Z0) -> Self::Output
impl<U: Unsigned + NonZero> Sub<Z0> for NInt<U>
type Output = NInt<U>;fn sub(self, Z0) -> Self::Output
impl<Ul, Ur> Max<NInt<Ur>> for NInt<Ul>
where
Ul: Unsigned + NonZero + Min<Ur>,
Ur: Unsigned + NonZero,
Minimum<Ul, Ur>: Unsigned + NonZero,
type Output = NInt<<Ul as Min<Ur>>::Output>;fn max(self, rhs: NInt<Ur>) -> Self::Output
impl<Ul, Ur> Max<PInt<Ur>> for NInt<Ul>
where
Ul: Unsigned + NonZero,
Ur: Unsigned + NonZero,
type Output = PInt<Ur>;fn max(self, rhs: PInt<Ur>) -> Self::Output
impl<Ul, Ur> Min<NInt<Ur>> for NInt<Ul>
where
Ul: Unsigned + NonZero + Max<Ur>,
Ur: Unsigned + NonZero,
Maximum<Ul, Ur>: Unsigned + NonZero,
type Output = NInt<<Ul as Max<Ur>>::Output>;fn min(self, rhs: NInt<Ur>) -> Self::Output
impl<Ul, Ur> Min<PInt<Ur>> for NInt<Ul>
where
Ul: Unsigned + NonZero,
Ur: Unsigned + NonZero,
type Output = NInt<Ul>;fn min(self, PInt<Ur>) -> Self::Output
impl<Ul, Ur: Unsigned + NonZero> Add<NInt<Ur>> for NInt<Ul>
where
Ul: Add<Ur> + Unsigned + NonZero,
<Ul as Add<Ur>>::Output: Unsigned + NonZero,
type Output = NInt<<Ul as Add<Ur>>::Output>;fn add(self, NInt<Ur>) -> Self::Output
impl<Ul, Ur: Unsigned + NonZero> Div<NInt<Ur>> for NInt<Ul>
where
Ul: Cmp<Ur> + Unsigned + NonZero,
NInt<Ul>: PrivateDivInt<<Ul as Cmp<Ur>>::Output, NInt<Ur>>,
type Output = <NInt<Ul> as PrivateDivInt<<Ul as Cmp<Ur>>::Output, NInt<Ur>>>::Output;fn div(self, rhs: NInt<Ur>) -> Self::Output
impl<Ul, Ur: Unsigned + NonZero> Div<PInt<Ur>> for NInt<Ul>
where
Ul: Cmp<Ur> + Unsigned + NonZero,
NInt<Ul>: PrivateDivInt<<Ul as Cmp<Ur>>::Output, PInt<Ur>>,
type Output = <NInt<Ul> as PrivateDivInt<<Ul as Cmp<Ur>>::Output, PInt<Ur>>>::Output;fn div(self, rhs: PInt<Ur>) -> Self::Output
impl<Ul, Ur: Unsigned + NonZero> Mul<NInt<Ur>> for NInt<Ul>
where
Ul: Mul<Ur> + Unsigned + NonZero,
<Ul as Mul<Ur>>::Output: Unsigned + NonZero,
type Output = PInt<<Ul as Mul<Ur>>::Output>;fn mul(self, NInt<Ur>) -> Self::Output
impl<Ul, Ur: Unsigned + NonZero> Mul<PInt<Ur>> for NInt<Ul>
where
Ul: Mul<Ur> + Unsigned + NonZero,
<Ul as Mul<Ur>>::Output: Unsigned + NonZero,
type Output = NInt<<Ul as Mul<Ur>>::Output>;fn mul(self, PInt<Ur>) -> Self::Output
impl<Ul, Ur: Unsigned + NonZero> Rem<NInt<Ur>> for NInt<Ul>
where
Ul: Rem<Ur> + Unsigned + NonZero,
NInt<Ul>: PrivateRem<<Ul as Rem<Ur>>::Output, NInt<Ur>>,
type Output = <NInt<Ul> as PrivateRem<<Ul as Rem<Ur>>::Output, NInt<Ur>>>::Output;fn rem(self, rhs: NInt<Ur>) -> Self::Output
impl<Ul, Ur: Unsigned + NonZero> Rem<PInt<Ur>> for NInt<Ul>
where
Ul: Rem<Ur> + Unsigned + NonZero,
NInt<Ul>: PrivateRem<<Ul as Rem<Ur>>::Output, PInt<Ur>>,
type Output = <NInt<Ul> as PrivateRem<<Ul as Rem<Ur>>::Output, PInt<Ur>>>::Output;fn rem(self, rhs: PInt<Ur>) -> Self::Output
impl<Ul, Ur: Unsigned + NonZero> Sub<PInt<Ur>> for NInt<Ul>
where
Ul: Add<Ur> + Unsigned + NonZero,
<Ul as Add<Ur>>::Output: Unsigned + NonZero,
type Output = NInt<<Ul as Add<Ur>>::Output>;fn sub(self, PInt<Ur>) -> Self::Output
impl<Ul, Ur: Unsigned> Pow<PInt<UInt<Ur, B0>>> for NInt<Ul>
where
Ul: Pow<UInt<Ur, B0>> + Unsigned + NonZero,
<Ul as Pow<UInt<Ur, B0>>>::Output: Unsigned + NonZero,
type Output = PInt<<Ul as Pow<UInt<Ur, B0>>>::Output>;fn powi(self, PInt<UInt<Ur, B0>>) -> Self::Output
impl<Ul, Ur: Unsigned> Pow<PInt<UInt<Ur, B1>>> for NInt<Ul>
where
Ul: Pow<UInt<Ur, B1>> + Unsigned + NonZero,
<Ul as Pow<UInt<Ur, B1>>>::Output: Unsigned + NonZero,
type Output = NInt<<Ul as Pow<UInt<Ur, B1>>>::Output>;fn powi(self, PInt<UInt<Ur, B1>>) -> Self::Output
impl<Ul: Unsigned + NonZero, Ur> Add<PInt<Ur>> for NInt<Ul>
where
Ur: Cmp<Ul> + PrivateIntegerAdd<<Ur as Cmp<Ul>>::Output, Ul> + Unsigned + NonZero,
type Output = <Ur as PrivateIntegerAdd<<Ur as Cmp<Ul>>::Output, Ul>>::Output;fn add(self, rhs: PInt<Ur>) -> Self::Output
impl<Ul: Unsigned + NonZero, Ur> Sub<NInt<Ur>> for NInt<Ul>
where
Ur: Cmp<Ul> + PrivateIntegerAdd<<Ur as Cmp<Ul>>::Output, Ul> + Unsigned + NonZero,
type Output = <Ur as PrivateIntegerAdd<<Ur as Cmp<Ul>>::Output, Ul>>::Output;fn sub(self, rhs: NInt<Ur>) -> Self::Output
impl<V, A, U> Mul<TArr<V, A>> for NInt<U>
where
U: Unsigned + NonZero,
NInt<U>: Mul<A> + Mul<V>,
type Output = TArr<<NInt<U> as Mul<V>>::Output, <NInt<U> as Mul<A>>::Output>;fn mul(self, rhs: TArr<V, A>) -> Self::Output
Auto Trait Implementations
impl<U> Freeze for NInt<U>
where
U: Freeze,
impl<U> RefUnwindSafe for NInt<U>
where
U: RefUnwindSafe,
impl<U> Send for NInt<U>
where
U: Send,
impl<U> Sync for NInt<U>
where
U: Sync,
impl<U> Unpin for NInt<U>
where
U: Unpin,
impl<U> UnsafeUnpin for NInt<U>
where
U: UnsafeUnpin,
impl<U> UnwindSafe for NInt<U>
where
U: UnwindSafe,
Blanket Implementations
impl<A, B> IsEqual<B> for NInt<U>
where
A: Cmp<B> + IsEqualPrivate<B, <A as Cmp<B>>::Output>,
type Output = <A as IsEqualPrivate<B, <A as Cmp<B>>::Output>>::Output;fn is_equal(self, rhs: B) -> <A as IsEqual<B>>::Output
impl<A, B> IsGreater<B> for NInt<U>
where
A: Cmp<B> + IsGreaterPrivate<B, <A as Cmp<B>>::Output>,
type Output = <A as IsGreaterPrivate<B, <A as Cmp<B>>::Output>>::Output;fn is_greater(self, rhs: B) -> <A as IsGreater<B>>::Output
impl<A, B> IsGreaterOrEqual<B> for NInt<U>
where
A: Cmp<B> + IsGreaterOrEqualPrivate<B, <A as Cmp<B>>::Output>,
type Output = <A as IsGreaterOrEqualPrivate<B, <A as Cmp<B>>::Output>>::Output;fn is_greater_or_equal(self, rhs: B) -> <A as IsGreaterOrEqual<B>>::Output
impl<A, B> IsLess<B> for NInt<U>
where
A: Cmp<B> + IsLessPrivate<B, <A as Cmp<B>>::Output>,
type Output = <A as IsLessPrivate<B, <A as Cmp<B>>::Output>>::Output;fn is_less(self, rhs: B) -> <A as IsLess<B>>::Output
impl<A, B> IsLessOrEqual<B> for NInt<U>
where
A: Cmp<B> + IsLessOrEqualPrivate<B, <A as Cmp<B>>::Output>,
type Output = <A as IsLessOrEqualPrivate<B, <A as Cmp<B>>::Output>>::Output;fn is_less_or_equal(self, rhs: B) -> <A as IsLessOrEqual<B>>::Output
impl<A, B> IsNotEqual<B> for NInt<U>
where
A: Cmp<B> + IsNotEqualPrivate<B, <A as Cmp<B>>::Output>,
type Output = <A as IsNotEqualPrivate<B, <A as Cmp<B>>::Output>>::Output;fn is_not_equal(self, rhs: B) -> <A as IsNotEqual<B>>::Output
impl<M, N> PartialDiv<N> for NInt<U>
where
M: Integer + Div<N> + Rem<N, Output = Z0>,
type Output = <M as Div<N>>::Output;fn partial_div(self, rhs: N) -> Self::Output
impl<T> Any for NInt<U>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for NInt<U>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for NInt<U>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for NInt<U>
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for NInt<U>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Same for NInt<U>
type Output = T;
impl<T, U> Into<U> for NInt<U>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for NInt<U>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for NInt<U>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>