Trait PyMod

Source
pub trait PyMod<Rhs = Self> {
    type Output;

    // Required method
    fn pymod(self, rhs: Rhs) -> Self::Output;
}
Expand description

The PyMod trait defines a pythonic modulo operator that can be used to perform modulo operations similar to Python’s % operator, which behaves differently than Rust’s % operator when dealing with negative numbers.

Required Associated Types§

Required Methods§

Source

fn pymod(self, rhs: Rhs) -> Self::Output

Implementors§

Source§

impl<A, B, C> PyMod<B> for A
where A: Rem<B, Output = C>, B: Copy + PartialOrd + Zero, C: PartialOrd + Zero + Add<B, Output = C>,