Trait core::ops::BitXorExperimental
[-]
[+]
[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!
.
#[deriving(Copy)] 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 bool
impl BitXor<uint, uint> for uint
impl BitXor<u8, u8> for u8
impl BitXor<u16, u16> for u16
impl BitXor<u32, u32> for u32
impl BitXor<u64, u64> for u64
impl BitXor<int, int> for int
impl BitXor<i8, i8> for i8
impl BitXor<i16, i16> for i16
impl BitXor<i32, i32> for i32
impl BitXor<i64, i64> for i64