Trait NumForKnuth

Source
pub trait NumForKnuth:
    Mul<Self, Output = Self>
    + for<'a> Mul<&'a Self, Output = Self>
    + Sub<Self, Output = Self>
    + Add<Output = Self>
    + PartialOrd
    + Clone
    + Unsigned
    + One
    + ToPrimitive { }
Expand description

Number that can be used either as the first or second number in hyperoperation. Automatically implemented for all fitting numbers.

§Notable implementors

  • All unsigned primitive numeric types
  • BigUint, which is useful to handle big results without overflowing

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<Num> NumForKnuth for Num
where Num: Mul<Num, Output = Num> + for<'a> Mul<&'a Self, Output = Self> + Sub<Num, Output = Num> + Add<Output = Num> + PartialOrd + Clone + Unsigned + One + ToPrimitive, for<'a> &'a Num: Mul<&'a Num, Output = Num>,