# Trait bitflags::__core::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

### `fn rem(self, rhs: RHS) -> Self::Output`

The method for the `%` operator

## Implementors

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

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)