Struct peano::Pred
[−]
[src]
pub struct Pred<N: NonPos> { // some fields omitted }
For any non-positive Peano number N
, we define its predecessor, Pred<N>
.
This gives us negative Peano numbers.
Trait Implementations
impl<N: Clone + NonPos> Clone for Pred<N>
[src]
fn clone(&self) -> Pred<N>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<N: Copy + NonPos> Copy for Pred<N>
[src]
impl<N: NonPos> Peano for Pred<N>
[src]
impl<N: NonPos> NonPos for Pred<N>
[src]
impl<N: NonPos> NonZero for Pred<N>
[src]
impl<Lhs, Rhs> Add<Rhs> for Pred<Lhs> where Lhs: NonPos + Add<Rhs>, Rhs: NonPos, Lhs::Output: NonPos
[src]
Add non-positive numbers to negative numbers (e.g. -2 + -3, -2 + 0)
type Output = Pred<Lhs::Output>
The resulting type after applying the +
operator
fn add(self, rhs: Rhs) -> Self::Output
The method for the +
operator
impl<Lhs, Rhs> Add<Succ<Rhs>> for Pred<Lhs> where Lhs: NonPos + Add<Rhs>, Rhs: NonNeg
[src]
Add positive and negative numbers (e.g. -2 + 3)
type Output = Lhs::Output
The resulting type after applying the +
operator
fn add(self, rhs: Succ<Rhs>) -> Self::Output
The method for the +
operator
impl<N> Neg for Pred<N> where N: NonPos + Neg, N::Output: NonNeg
[src]
Negate negative numbers (e.g. -5 -> 5)
type Output = Succ<N::Output>
The resulting type after applying the -
operator
fn neg(self) -> Self::Output
The method for the unary -
operator
impl<Lhs> Sub<Zero> for Pred<Lhs> where Lhs: NonPos
[src]
Subtract Zero from negative numbers (e.g. -2 - 0)
type Output = Pred<Lhs>
The resulting type after applying the -
operator
fn sub(self, rhs: Zero) -> Self::Output
The method for the -
operator
impl<Lhs, Rhs> Sub<Pred<Rhs>> for Pred<Lhs> where Lhs: NonPos + Sub<Rhs>, Rhs: NonPos
[src]
Subtract negative numbers from negative numbers (e.g. -3 - -4)
type Output = Lhs::Output
The resulting type after applying the -
operator
fn sub(self, rhs: Pred<Rhs>) -> Self::Output
The method for the -
operator
impl<Lhs, Rhs> Sub<Succ<Rhs>> for Pred<Lhs> where Lhs: NonPos + Sub<Rhs>, Rhs: NonNeg, Lhs::Output: NonPos
[src]
Subtract positive numbers from negative numbers (e.g. -3 - 4)
type Output = Pred<Pred<Lhs::Output>>
The resulting type after applying the -
operator
fn sub(self, rhs: Succ<Rhs>) -> Self::Output
The method for the -
operator
impl<Lhs, Rhs> Mul<Rhs> for Pred<Lhs> where Lhs: NonPos + Mul<Rhs>, Rhs: Peano, Lhs::Output: Sub<Rhs>
[src]
Multiply negative numbers by integers (e.g. -2 * N)
type Output = Lhs::Output::Output
The resulting type after applying the *
operator
fn mul(self, rhs: Rhs) -> Self::Output
The method for the *
operator
impl<Lhs, Rhs> Div<Rhs> for Pred<Lhs> where Lhs: NonPos + Neg, Rhs: Neg, Succ<Lhs::Output>: DivPrivate<Rhs::Output>, Lhs::Output: NonNeg
[src]
Divide a negative number by a non-zero number (e.g. -4 / 2, -4 / -2). Only defined for numbers that are evenly divisible.
type Output = Pred<Lhs>::Output::Output
The resulting type after applying the /
operator
fn div(self, rhs: Rhs) -> Self::Output
The method for the /
operator