# Trait bitflags::__core::ops::BitOr [−] [src]

    pub trait BitOr<RHS = Self> {
        type Output;
        fn bitor(self, rhs: RHS) -> Self::Output;
    }

The `BitOr` trait is used to specify the functionality of `|`.

# Examples

A trivial implementation of `BitOr`. When `Foo | Foo` happens, it ends up calling `bitor`, and therefore, `main` prints `Bitwise Or-ing!`.

    use std::ops::BitOr;

    struct Foo;

    impl BitOr for Foo {
        type Output = Foo;

        fn bitor(self, _rhs: Foo) -> Foo {
            println!("Bitwise Or-ing!");
            self
        }
    }

    fn main() {
        Foo | Foo;
    }

## Associated Types

### `type Output`

The resulting type after applying the `|` operator

## Required Methods

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

The method for the `|` operator

## Implementors

- `impl<'a, 'b, T, S> BitOr for &'a HashSet<T, S> where S: BuildHasher + Default, T: Eq + Hash + Clone`
- `impl BitOr for bool`
- `impl<'a> BitOr for &'a bool`
- `impl<'a> BitOr for bool`
- `impl<'a, 'b> BitOr for &'b bool`
- `impl BitOr for usize`
- `impl<'a> BitOr for &'a usize`
- `impl<'a> BitOr for usize`
- `impl<'a, 'b> BitOr for &'b usize`
- `impl BitOr for u8`
- `impl<'a> BitOr for &'a u8`
- `impl<'a> BitOr for u8`
- `impl<'a, 'b> BitOr for &'b u8`
- `impl BitOr for u16`
- `impl<'a> BitOr for &'a u16`
- `impl<'a> BitOr for u16`
- `impl<'a, 'b> BitOr for &'b u16`
- `impl BitOr for u32`
- `impl<'a> BitOr for &'a u32`
- `impl<'a> BitOr for u32`
- `impl<'a, 'b> BitOr for &'b u32`
- `impl BitOr for u64`
- `impl<'a> BitOr for &'a u64`
- `impl<'a> BitOr for u64`
- `impl<'a, 'b> BitOr for &'b u64`
- `impl BitOr for isize`
- `impl<'a> BitOr for &'a isize`
- `impl<'a> BitOr for isize`
- `impl<'a, 'b> BitOr for &'b isize`
- `impl BitOr for i8`
- `impl<'a> BitOr for &'a i8`
- `impl<'a> BitOr for i8`
- `impl<'a, 'b> BitOr for &'b i8`
- `impl BitOr for i16`
- `impl<'a> BitOr for &'a i16`
- `impl<'a> BitOr for i16`
- `impl<'a, 'b> BitOr for &'b i16`
- `impl BitOr for i32`
- `impl<'a> BitOr for &'a i32`
- `impl<'a> BitOr for i32`
- `impl<'a, 'b> BitOr for &'b i32`
- `impl BitOr for i64`
- `impl<'a> BitOr for &'a i64`
- `impl<'a> BitOr for i64`
- `impl<'a, 'b> BitOr for &'b i64`
- `impl BitOr for Wrapping<usize>`
- `impl BitOr for Wrapping<u8>`
- `impl BitOr for Wrapping<u16>`
- `impl BitOr for Wrapping<u32>`
- `impl BitOr for Wrapping<u64>`
- `impl BitOr for Wrapping<isize>`
- `impl BitOr for Wrapping<i8>`
- `impl BitOr for Wrapping<i16>`
- `impl BitOr for Wrapping<i32>`
- `impl BitOr for Wrapping<i64>`
- `impl<'a, 'b, T> BitOr for &'a BTreeSet<T> where T: Ord + Clone`
- `impl<E> BitOr for EnumSet<E> where E: CLike`

# 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`)