Trait std::ops::Rem
[−]
[src]
pub trait Rem<RHS = Self> { type Output = Self; fn rem(self, rhs: RHS) -> Self::Output; }
The Rem
trait is used to specify the functionality of %
.
Examples
A trivial implementation of Rem
. When Foo % Foo
happens, it ends up
calling rem
, and therefore, main
prints Remainder-ing!
.
use std::ops::Rem; struct Foo; impl Rem for Foo { type Output = Foo; fn rem(self, _rhs: Foo) -> Foo { println!("Remainder-ing!"); self } } fn main() { Foo % Foo; }
Associated Types
type Output = Self
The resulting type after applying the %
operator
Required Methods
Implementors
impl Rem<Wrapping<usize>> for Wrapping<usize>
impl Rem<Wrapping<u8>> for Wrapping<u8>
impl Rem<Wrapping<u16>> for Wrapping<u16>
impl Rem<Wrapping<u32>> for Wrapping<u32>
impl Rem<Wrapping<u64>> for Wrapping<u64>
impl Rem<Wrapping<isize>> for Wrapping<isize>
impl Rem<Wrapping<i8>> for Wrapping<i8>
impl Rem<Wrapping<i16>> for Wrapping<i16>
impl Rem<Wrapping<i32>> for Wrapping<i32>
impl Rem<Wrapping<i64>> for Wrapping<i64>
impl Rem<usize> for usize
impl<'a> Rem<usize> for &'a usize
impl<'a> Rem<&'a usize> for usize
impl<'a, 'b> Rem<&'a usize> for &'b usize
impl Rem<u8> for u8
impl<'a> Rem<u8> for &'a u8
impl<'a> Rem<&'a u8> for u8
impl<'a, 'b> Rem<&'a u8> for &'b u8
impl Rem<u16> for u16
impl<'a> Rem<u16> for &'a u16
impl<'a> Rem<&'a u16> for u16
impl<'a, 'b> Rem<&'a u16> for &'b u16
impl Rem<u32> for u32
impl<'a> Rem<u32> for &'a u32
impl<'a> Rem<&'a u32> for u32
impl<'a, 'b> Rem<&'a u32> for &'b u32
impl Rem<u64> for u64
impl<'a> Rem<u64> for &'a u64
impl<'a> Rem<&'a u64> for u64
impl<'a, 'b> Rem<&'a u64> for &'b u64
impl Rem<isize> for isize
impl<'a> Rem<isize> for &'a isize
impl<'a> Rem<&'a isize> for isize
impl<'a, 'b> Rem<&'a isize> for &'b isize
impl Rem<i8> for i8
impl<'a> Rem<i8> for &'a i8
impl<'a> Rem<&'a i8> for i8
impl<'a, 'b> Rem<&'a i8> for &'b i8
impl Rem<i16> for i16
impl<'a> Rem<i16> for &'a i16
impl<'a> Rem<&'a i16> for i16
impl<'a, 'b> Rem<&'a i16> for &'b i16
impl Rem<i32> for i32
impl<'a> Rem<i32> for &'a i32
impl<'a> Rem<&'a i32> for i32
impl<'a, 'b> Rem<&'a i32> for &'b i32
impl Rem<i64> for i64
impl<'a> Rem<i64> for &'a i64
impl<'a> Rem<&'a i64> for i64
impl<'a, 'b> Rem<&'a i64> for &'b i64
impl Rem<f32> for f32
impl<'a> Rem<f32> for &'a f32
impl<'a> Rem<&'a f32> for f32
impl<'a, 'b> Rem<&'a f32> for &'b f32
impl Rem<f64> for f64
impl<'a> Rem<f64> for &'a f64
impl<'a> Rem<&'a f64> for f64
impl<'a, 'b> Rem<&'a f64> for &'b f64