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<'a, 'b> Rem for &'b f64
impl<'a> Rem for f64
impl<'a> Rem for &'a f64
impl Rem for f64
impl<'a, 'b> Rem for &'b f32
impl<'a> Rem for f32
impl<'a> Rem for &'a f32
impl Rem for f32
impl<'a, 'b> Rem for &'b i64
impl<'a> Rem for i64
impl<'a> Rem for &'a i64
impl Rem for i64
impl<'a, 'b> Rem for &'b i32
impl<'a> Rem for i32
impl<'a> Rem for &'a i32
impl Rem for i32
impl<'a, 'b> Rem for &'b i16
impl<'a> Rem for i16
impl<'a> Rem for &'a i16
impl Rem for i16
impl<'a, 'b> Rem for &'b i8
impl<'a> Rem for i8
impl<'a> Rem for &'a i8
impl Rem for i8
impl<'a, 'b> Rem for &'b isize
impl<'a> Rem for isize
impl<'a> Rem for &'a isize
impl Rem for isize
impl<'a, 'b> Rem for &'b u64
impl<'a> Rem for u64
impl<'a> Rem for &'a u64
impl Rem for u64
impl<'a, 'b> Rem for &'b u32
impl<'a> Rem for u32
impl<'a> Rem for &'a u32
impl Rem for u32
impl<'a, 'b> Rem for &'b u16
impl<'a> Rem for u16
impl<'a> Rem for &'a u16
impl Rem for u16
impl<'a, 'b> Rem for &'b u8
impl<'a> Rem for u8
impl<'a> Rem for &'a u8
impl Rem for u8
impl<'a, 'b> Rem for &'b usize
impl<'a> Rem for usize
impl<'a> Rem for &'a usize
impl Rem for usize
impl Rem for Wrapping<i64>
impl Rem for Wrapping<i32>
impl Rem for Wrapping<i16>
impl Rem for Wrapping<i8>
impl Rem for Wrapping<isize>
impl Rem for Wrapping<u64>
impl Rem for Wrapping<u32>
impl Rem for Wrapping<u16>
impl Rem for Wrapping<u8>
impl Rem for Wrapping<usize>