Struct PInt

pub struct PInt<U: Unsigned + NonZero> { /* private fields */ }

Type-level signed integers with positive sign.

Implementations

impl<U: Unsigned + NonZero> PInt<U>

fn new() -> PInt<U>

Instantiates a singleton representing this strictly positive integer.

Trait Implementations

impl<P: Unsigned + NonZero, N: Unsigned + NonZero> Cmp<NInt<N>> for PInt<P>

type Output = Greater;

impl<Pl: Cmp<Pr> + Unsigned + NonZero, Pr: Unsigned + NonZero> Cmp<PInt<Pr>> for PInt<Pl>

type Output = <Pl as Cmp<Pr>>::Output;

impl<U> Gcd<Z0> for PInt<U> where U: Unsigned + NonZero,

type Output = PInt<U>;

impl<U> Max<Z0> for PInt<U> where U: Unsigned + NonZero,

type Output = PInt<U>;
fn max(self, Z0) -> Self::Output

impl<U> Min<Z0> for PInt<U> where U: Unsigned + NonZero,

type Output = Z0;
fn min(self, rhs: Z0) -> Self::Output

impl<U> Mul<ATerm> for PInt<U> where U: Unsigned + NonZero,

type Output = ATerm;
fn mul(self, ATerm) -> Self::Output

impl<U> ToInt<i16> for PInt<U> where U: Unsigned + NonZero,

fn to_int() -> i16
const INT: i16 = Self::I16;

impl<U> ToInt<i32> for PInt<U> where U: Unsigned + NonZero,

fn to_int() -> i32
const INT: i32 = Self::I32;

impl<U> ToInt<i64> for PInt<U> where U: Unsigned + NonZero,

fn to_int() -> i64
const INT: i64 = Self::I64;

impl<U> ToInt<i8> for PInt<U> where U: Unsigned + NonZero,

fn to_int() -> i8
const INT: i8 = Self::I8;

impl<U> ToInt<isize> for PInt<U> where U: Unsigned + NonZero,

fn to_int() -> isize
const INT: isize = Self::ISIZE;

impl<U1, U2> Gcd<NInt<U2>> for PInt<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 PInt<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 PInt<U>

fn clone(&self) -> Self

impl<U: Copy + Unsigned + NonZero> Copy for PInt<U>

impl<U: Debug + Unsigned + NonZero> Debug for PInt<U>

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl<U: Default + Unsigned + NonZero> Default for PInt<U>

fn default() -> Self

impl<U: Eq + Unsigned + NonZero> Eq for PInt<U>

impl<U: Hash + Unsigned + NonZero> Hash for PInt<U>

fn hash<__H: Hasher>(&self, state: &mut __H)

impl<U: Ord + Unsigned + NonZero> Ord for PInt<U>

fn cmp(&self, other: &Self) -> Ordering

impl<U: PartialEq + Unsigned + NonZero> PartialEq for PInt<U>

fn eq(&self, other: &Self) -> bool

impl<U: PartialEq + Unsigned + NonZero> StructuralPartialEq for PInt<U>

impl<U: PartialOrd + Unsigned + NonZero> PartialOrd for PInt<U>

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

impl<U: Unsigned + NonZero + Binary> Binary for PInt<U>

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl<U: Unsigned + NonZero + PowerOfTwo> PowerOfTwo for PInt<U>

impl<U: Unsigned + NonZero> Abs for PInt<U>

type Output = PInt<U>;

impl<U: Unsigned + NonZero> Add<Z0> for PInt<U>

type Output = PInt<U>;
fn add(self, Z0) -> Self::Output

impl<U: Unsigned + NonZero> Cmp<Z0> for PInt<U>

type Output = Greater;

impl<U: Unsigned + NonZero> Integer for PInt<U>

const I8: i8 = U::I8;
const I16: i16 = U::I16;
const I32: i32 = U::I32;
const I64: i64 = U::I64;
const ISIZE: isize = U::ISIZE;
fn to_i8() -> i8
fn to_i16() -> i16
fn to_i32() -> i32
fn to_i64() -> i64
fn to_isize() -> isize

impl<U: Unsigned + NonZero> Mul<Z0> for PInt<U>

type Output = Z0;
fn mul(self, Z0) -> Self::Output

impl<U: Unsigned + NonZero> Neg for PInt<U>

type Output = NInt<U>;
fn neg(self) -> Self::Output

impl<U: Unsigned + NonZero> NonZero for PInt<U>

impl<U: Unsigned + NonZero> Pow<Z0> for PInt<U>

type Output = PInt<UInt<UTerm, B1>>;
fn powi(self, Z0) -> Self::Output

impl<U: Unsigned + NonZero> Sub<Z0> for PInt<U>

type Output = PInt<U>;
fn sub(self, Z0) -> Self::Output

impl<Ul, Ur> Max<NInt<Ur>> for PInt<Ul> where Ul: Unsigned + NonZero, Ur: Unsigned + NonZero,

type Output = PInt<Ul>;
fn max(self, NInt<Ur>) -> Self::Output

impl<Ul, Ur> Max<PInt<Ur>> for PInt<Ul> where Ul: Unsigned + NonZero + Max<Ur>, Ur: Unsigned + NonZero, Maximum<Ul, Ur>: Unsigned + NonZero,

type Output = PInt<<Ul as Max<Ur>>::Output>;
fn max(self, rhs: PInt<Ur>) -> Self::Output

impl<Ul, Ur> Min<NInt<Ur>> for PInt<Ul> where Ul: Unsigned + NonZero, Ur: Unsigned + NonZero,

type Output = NInt<Ur>;
fn min(self, rhs: NInt<Ur>) -> Self::Output

impl<Ul, Ur> Min<PInt<Ur>> for PInt<Ul> where Ul: Unsigned + NonZero + Min<Ur>, Ur: Unsigned + NonZero, Minimum<Ul, Ur>: Unsigned + NonZero,

type Output = PInt<<Ul as Min<Ur>>::Output>;
fn min(self, rhs: PInt<Ur>) -> Self::Output

impl<Ul, Ur: Unsigned + NonZero> Add<NInt<Ur>> for PInt<Ul> where Ul: Cmp<Ur> + PrivateIntegerAdd<<Ul as Cmp<Ur>>::Output, Ur> + Unsigned + NonZero,

type Output = <Ul as PrivateIntegerAdd<<Ul as Cmp<Ur>>::Output, Ur>>::Output;
fn add(self, rhs: NInt<Ur>) -> Self::Output

impl<Ul, Ur: Unsigned + NonZero> Add<PInt<Ur>> for PInt<Ul> where Ul: Add<Ur> + Unsigned + NonZero, <Ul as Add<Ur>>::Output: Unsigned + NonZero,

type Output = PInt<<Ul as Add<Ur>>::Output>;
fn add(self, PInt<Ur>) -> Self::Output

impl<Ul, Ur: Unsigned + NonZero> Div<NInt<Ur>> for PInt<Ul> where Ul: Cmp<Ur> + Unsigned + NonZero, PInt<Ul>: PrivateDivInt<<Ul as Cmp<Ur>>::Output, NInt<Ur>>,

type Output = <PInt<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 PInt<Ul> where Ul: Cmp<Ur> + Unsigned + NonZero, PInt<Ul>: PrivateDivInt<<Ul as Cmp<Ur>>::Output, PInt<Ur>>,

type Output = <PInt<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 PInt<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, NInt<Ur>) -> Self::Output

impl<Ul, Ur: Unsigned + NonZero> Mul<PInt<Ur>> for PInt<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, PInt<Ur>) -> Self::Output

impl<Ul, Ur: Unsigned + NonZero> Pow<PInt<Ur>> for PInt<Ul> where Ul: Pow<Ur> + Unsigned + NonZero, <Ul as Pow<Ur>>::Output: Unsigned + NonZero,

type Output = PInt<<Ul as Pow<Ur>>::Output>;
fn powi(self, PInt<Ur>) -> Self::Output

impl<Ul, Ur: Unsigned + NonZero> Rem<NInt<Ur>> for PInt<Ul> where Ul: Rem<Ur> + Unsigned + NonZero, PInt<Ul>: PrivateRem<<Ul as Rem<Ur>>::Output, NInt<Ur>>,

type Output = <PInt<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 PInt<Ul> where Ul: Rem<Ur> + Unsigned + NonZero, PInt<Ul>: PrivateRem<<Ul as Rem<Ur>>::Output, PInt<Ur>>,

type Output = <PInt<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<NInt<Ur>> for PInt<Ul> where Ul: Add<Ur> + Unsigned + NonZero, <Ul as Add<Ur>>::Output: Unsigned + NonZero,

type Output = PInt<<Ul as Add<Ur>>::Output>;
fn sub(self, NInt<Ur>) -> Self::Output

impl<Ul, Ur: Unsigned + NonZero> Sub<PInt<Ur>> for PInt<Ul> where Ul: Cmp<Ur> + PrivateIntegerAdd<<Ul as Cmp<Ur>>::Output, Ur> + Unsigned + NonZero,

type Output = <Ul as PrivateIntegerAdd<<Ul as Cmp<Ur>>::Output, Ur>>::Output;
fn sub(self, rhs: PInt<Ur>) -> Self::Output

impl<V, A, U> Mul<TArr<V, A>> for PInt<U> where U: Unsigned + NonZero, PInt<U>: Mul<A> + Mul<V>,

type Output = TArr<<PInt<U> as Mul<V>>::Output, <PInt<U> as Mul<A>>::Output>;
fn mul(self, rhs: TArr<V, A>) -> Self::Output

Auto Trait Implementations

impl<U> Freeze for PInt<U> where U: Freeze,

impl<U> RefUnwindSafe for PInt<U> where U: RefUnwindSafe,

impl<U> Send for PInt<U> where U: Send,

impl<U> Sync for PInt<U> where U: Sync,

impl<U> Unpin for PInt<U> where U: Unpin,

impl<U> UnsafeUnpin for PInt<U> where U: UnsafeUnpin,

impl<U> UnwindSafe for PInt<U> where U: UnwindSafe,

Blanket Implementations

impl<A, B> IsEqual<B> for PInt<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 PInt<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 PInt<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 PInt<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 PInt<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 PInt<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 PInt<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 PInt<U> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for PInt<U> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for PInt<U> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> CloneToUninit for PInt<U> where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for PInt<U>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Same for PInt<U>

type Output = T;

impl<T, U> Into<U> for PInt<U> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for PInt<U> where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for PInt<U> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>