Trait core::ops::BitXor[src]
pub trait BitXor<RHS, Result> {
fn bitxor(&self, rhs: &RHS) -> Result;
}The BitXor trait is used to specify the functionality of ^.
Example
A trivial implementation of BitXor. When Foo ^ Foo happens, it ends up
calling bitxor, and therefore, main prints Bitwise Xor-ing!.
struct Foo; impl BitXor<Foo, Foo> for Foo { fn bitxor(&self, _rhs: &Foo) -> Foo { println!("Bitwise Xor-ing!"); *self } } fn main() { Foo ^ Foo; }
Required Methods
fn bitxor(&self, rhs: &RHS) -> Result
The method for the ^ operator
Implementors
impl BitXor<bool, bool> for boolimpl BitXor<uint, uint> for uintimpl BitXor<u8, u8> for u8impl BitXor<u16, u16> for u16impl BitXor<u32, u32> for u32impl BitXor<u64, u64> for u64impl BitXor<int, int> for intimpl BitXor<i8, i8> for i8impl BitXor<i16, i16> for i16impl BitXor<i32, i32> for i32impl BitXor<i64, i64> for i64