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!.

use std::ops::BitXorAssign; struct Foo; impl BitXorAssign for Foo { fn bitxor_assign(&mut self, _rhs: Foo) { println!("Bitwise Xor-ing!"); } } #[allow(unused_assignments)] fn main() { let mut foo = Foo; foo ^= Foo; }
use std::ops::BitXorAssign;

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