# Trait core::ops::BitXor [−] [src]

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

The `BitXor` trait is used to specify the functionality of `^`.

# Examples

A trivial implementation of `BitXor`. When `Foo ^ Foo` happens, it ends up calling `bitxor`, and therefore, `main` prints `Bitwise Xor-ing!`.

use std::ops::BitXor; struct Foo; impl BitXor for Foo { type Output = Foo; fn bitxor(self, _rhs: Foo) -> Foo { println!("Bitwise Xor-ing!"); self } } fn main() { Foo ^ Foo; }

    use std::ops::BitXor;

    struct Foo;

    impl BitXor for Foo {
        type Output = Foo;

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

    fn main() {
        Foo ^ Foo;
    }

## Associated Types

### `type Output`

The resulting type after applying the `^` operator

## Required Methods

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

The method for the `^` operator

## Implementors

- `impl BitXor for Wrapping<usize>`
- `impl BitXor for Wrapping<u8>`
- `impl BitXor for Wrapping<u16>`
- `impl BitXor for Wrapping<u32>`
- `impl BitXor for Wrapping<u64>`
- `impl BitXor for Wrapping<isize>`
- `impl BitXor for Wrapping<i8>`
- `impl BitXor for Wrapping<i16>`
- `impl BitXor for Wrapping<i32>`
- `impl BitXor for Wrapping<i64>`
- `impl BitXor for bool`
- `impl<'a> BitXor<bool> for &'a bool`
- `impl<'a> BitXor<&'a bool> for bool`
- `impl<'a, 'b> BitXor<&'a bool> for &'b bool`
- `impl BitXor for usize`
- `impl<'a> BitXor<usize> for &'a usize`
- `impl<'a> BitXor<&'a usize> for usize`
- `impl<'a, 'b> BitXor<&'a usize> for &'b usize`
- `impl BitXor for u8`
- `impl<'a> BitXor<u8> for &'a u8`
- `impl<'a> BitXor<&'a u8> for u8`
- `impl<'a, 'b> BitXor<&'a u8> for &'b u8`
- `impl BitXor for u16`
- `impl<'a> BitXor<u16> for &'a u16`
- `impl<'a> BitXor<&'a u16> for u16`
- `impl<'a, 'b> BitXor<&'a u16> for &'b u16`
- `impl BitXor for u32`
- `impl<'a> BitXor<u32> for &'a u32`
- `impl<'a> BitXor<&'a u32> for u32`
- `impl<'a, 'b> BitXor<&'a u32> for &'b u32`
- `impl BitXor for u64`
- `impl<'a> BitXor<u64> for &'a u64`
- `impl<'a> BitXor<&'a u64> for u64`
- `impl<'a, 'b> BitXor<&'a u64> for &'b u64`
- `impl BitXor for isize`
- `impl<'a> BitXor<isize> for &'a isize`
- `impl<'a> BitXor<&'a isize> for isize`
- `impl<'a, 'b> BitXor<&'a isize> for &'b isize`
- `impl BitXor for i8`
- `impl<'a> BitXor<i8> for &'a i8`
- `impl<'a> BitXor<&'a i8> for i8`
- `impl<'a, 'b> BitXor<&'a i8> for &'b i8`
- `impl BitXor for i16`
- `impl<'a> BitXor<i16> for &'a i16`
- `impl<'a> BitXor<&'a i16> for i16`
- `impl<'a, 'b> BitXor<&'a i16> for &'b i16`
- `impl BitXor for i32`
- `impl<'a> BitXor<i32> for &'a i32`
- `impl<'a> BitXor<&'a i32> for i32`
- `impl<'a, 'b> BitXor<&'a i32> for &'b i32`
- `impl BitXor for i64`
- `impl<'a> BitXor<i64> for &'a i64`
- `impl<'a> BitXor<&'a i64> for i64`
- `impl<'a, 'b> BitXor<&'a i64> for &'b 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`)