Trait core::ops::BitXorAssign
[−]
[src]
pub trait BitXorAssign<Rhs = Self> { fn bitxor_assign(&mut self, Rhs); }
The BitXorAssign
trait is used to specify the functionality of ^=
.
Examples
A trivial implementation of BitXorAssign
. When Foo ^= Foo
happens, it ends up
calling bitxor_assign
, and therefore, main
prints Bitwise Xor-ing!
.
#![feature(augmented_assignments)] #![feature(op_assign_traits)] use std::ops::BitXorAssign; #[derive(Copy, Clone)] struct Foo; impl BitXorAssign for Foo { fn bitxor_assign(&mut self, _rhs: Foo) { println!("Bitwise Xor-ing!"); } } fn main() { let mut foo = Foo; foo ^= Foo; }
Required Methods
fn bitxor_assign(&mut self, Rhs)
The method for the ^=
operator
Implementors
impl BitXorAssign for bool
impl BitXorAssign for usize
impl BitXorAssign for u8
impl BitXorAssign for u16
impl BitXorAssign for u32
impl BitXorAssign for u64
impl BitXorAssign for isize
impl BitXorAssign for i8
impl BitXorAssign for i16
impl BitXorAssign for i32
impl BitXorAssign for i64