Trait std::ops::BitXorStable
[-]
[+]
[src]
pub trait BitXor<RHS = Self> {
type Output;
fn bitxor(self, rhs: RHS) -> <Self as BitXor<RHS>>::Output;
}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!.
#![feature(associated_types)] use std::ops::BitXor; #[derive(Copy)] struct Foo; impl BitXor for Foo { type Output = Foo; fn bitxor(self, _rhs: Foo) -> Foo { println!("Bitwise Xor-ing!"); self } } fn main() { Foo ^ Foo; }
Required Methods
Implementors
impl BitXor<bool> for boolimpl BitXor<usize> for usizeimpl BitXor<u8> for u8impl BitXor<u16> for u16impl BitXor<u32> for u32impl BitXor<u64> for u64impl BitXor<isize> for isizeimpl BitXor<i8> for i8impl BitXor<i16> for i16impl BitXor<i32> for i32impl BitXor<i64> for i64impl BitXor for FilePermissionimpl<'a, 'b, T, S, H> BitXor<&'b HashSet<T, S>> for &'a HashSet<T, S> where T: Eq + Hash<H> + Clone, S: HashState<Hasher=H> + Default, H: Hasher<Output=u64>impl<'a, 'b, T, S, H> BitXor<&'b HashSet<T, S>> for &'a HashSet<T, S> where T: Eq + Hash<H> + Clone, S: HashState<Hasher=H> + Default, H: Hasher<Output=u64>impl<'a, 'b, T: Ord + Clone> BitXor<&'b BTreeSet<T>> for &'a BTreeSet<T>impl<E: CLike> BitXor<EnumSet<E>> for EnumSet<E>