Struct Succ

Source
pub struct Succ<T>
where T: Nat,
{ /* private fields */ }
Expand description

§Peano-style increment operator

assert_eq!(Succ::<Six>::eval(), 7);

Trait Implementations§

Source§

impl<T, U: Nat> Equals<Succ<T>> for Succ<U>
where T: Equals<U> + Nat,

Source§

type Result = <T as Equals<U>>::Result

Source§

impl<T: Nat> Equals<Succ<T>> for Zero

Source§

impl<T: Nat> Equals<Zero> for Succ<T>

Source§

impl<T> Eval for Succ<T>
where T: Eval<Output = usize> + Nat,

Source§

type Output = usize

The Rust representation of our type.
Source§

fn eval() -> Self::Output

A static function to actually grab the data. Read more
Source§

impl<T, U> Fact for Succ<T>
where T: Fact<Result = U> + Nat, U: Times<Succ<T>> + Nat,

Source§

type Result = <U as Times<Succ<T>>>::Result

Source§

impl<T, U: Bool, V: Nat, W: Nat> Fib for Succ<T>
where T: Equals<Zero, Result = U> + Nat, Succ<T>: FibRecurse<Result = V>, (One, V): If<U, Result = W>,

Source§

impl<T: Nat, U> LessThan<Succ<T>> for Succ<U>
where U: LessThan<T> + Nat,

Source§

type Result = <U as LessThan<T>>::Result

Source§

impl<T: Nat> LessThan<Succ<T>> for Zero

Source§

impl<T: Nat> LessThan<Zero> for Succ<T>

Source§

impl<T: Nat, U: Nat, V, W: Nat, C: Bool> Mod<T> for Succ<U>
where Self: Minus<T, Result = V> + LessThan<T, Result = C>, V: Mod<T> + Nat, (Self, <V as Mod<T>>::Result): If<C, Result = W>,

Source§

impl<T: Nat, U> Plus<T> for Succ<U>
where U: Plus<T> + Nat,

Source§

type Result = Succ<<U as Plus<T>>::Result>

Source§

impl<T: Nat> Pred for Succ<T>

Source§

impl<T: Nat, U, V> Times<T> for Succ<U>
where U: Times<T, Result = V> + Nat, V: Plus<T> + Nat,

Source§

type Result = <V as Plus<T>>::Result

Source§

impl<T: Nat> Nat for Succ<T>

Auto Trait Implementations§

§

impl<T> Freeze for Succ<T>

§

impl<T> RefUnwindSafe for Succ<T>
where T: RefUnwindSafe,

§

impl<T> Send for Succ<T>
where T: Send,

§

impl<T> Sync for Succ<T>
where T: Sync,

§

impl<T> Unpin for Succ<T>
where T: Unpin,

§

impl<T> UnwindSafe for Succ<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U, V> Minus<Succ<T>> for U
where T: Nat, U: Nat + Minus<T, Result = V>, V: Nat + Pred,

Source§

type Result = <V as Pred>::Result

Source§

impl<T> Minus<Zero> for T
where T: Nat,

Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.