Struct peano::Succ [] [src]

pub struct Succ<N: NonNeg> { /* fields omitted */ }

For any non-negative Peano number N, we define its successor, Succ<N>.

This gives us positive Peano numbers.

Trait Implementations

impl<N: Copy + NonNeg> Copy for Succ<N>
[src]

impl<N: Clone + NonNeg> Clone for Succ<N>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<N: NonNeg> Peano for Succ<N>
[src]

impl<N: NonNeg> NonNeg for Succ<N>
[src]

impl<N: NonNeg> NonZero for Succ<N>
[src]

impl<Lhs, Rhs> Add<Rhs> for Succ<Lhs> where
    Lhs: NonNeg + Add<Rhs>,
    Rhs: NonNeg,
    <Lhs as Add<Rhs>>::Output: NonNeg
[src]

Add non-negative numbers to positive numbers (e.g. 2 + 3, 2 + 0)

The resulting type after applying the + operator

The method for the + operator

impl<Lhs, Rhs> Add<Pred<Rhs>> for Succ<Lhs> where
    Lhs: NonNeg + Add<Rhs>,
    Rhs: NonPos
[src]

Add negative and positive numbers (e.g. 2 + -3)

The resulting type after applying the + operator

The method for the + operator

impl<N> Neg for Succ<N> where
    N: NonNeg + Neg,
    <N as Neg>::Output: NonPos
[src]

Negate positive numbers (e.g. 5 -> -5)

The resulting type after applying the - operator

The method for the unary - operator

impl<Lhs> Sub<Zero> for Succ<Lhs> where
    Lhs: NonNeg
[src]

Subtract Zero from positive numbers (e.g. 2 - 0)

The resulting type after applying the - operator

The method for the - operator

impl<Lhs, Rhs> Sub<Succ<Rhs>> for Succ<Lhs> where
    Lhs: NonNeg + Sub<Rhs>,
    Rhs: NonNeg
[src]

Subtract positive numbers from positive numbers (e.g. 3 - 4)

The resulting type after applying the - operator

The method for the - operator

impl<Lhs, Rhs> Sub<Pred<Rhs>> for Succ<Lhs> where
    Lhs: NonNeg + Sub<Rhs>,
    Rhs: NonPos,
    <Lhs as Sub<Rhs>>::Output: NonNeg
[src]

Subtract negative numbers from positive numbers (e.g. 3 - -4)

The resulting type after applying the - operator

The method for the - operator

impl<Lhs, Rhs> Mul<Rhs> for Succ<Lhs> where
    Lhs: NonNeg + Mul<Rhs>,
    Rhs: Add<<Lhs as Mul<Rhs>>::Output>, 
[src]

Multiply positive numbers by integers (e.g. 2 * N)

The resulting type after applying the * operator

The method for the * operator

impl<Lhs, Rhs> Div<Rhs> for Succ<Lhs> where
    Lhs: NonNeg,
    Succ<Lhs>: DivPrivate<Rhs>, 
[src]

Divide a positive number by a non-zero number (e.g. 4 / 2, 4 / -2). Only defined for numbers that are evenly divisible.

The resulting type after applying the / operator

The method for the / operator

impl<N: NonNeg + ToInt> ToInt for Succ<N>
[src]