[][src]Trait rug::ops::BitXorFrom

pub trait BitXorFrom<Lhs = Self> {
    fn bitxor_from(&mut self, lhs: Lhs);
}

Compound bitwise XOR and assignment to the rhs operand.

rhs.bitxor_from(lhs) has the same effect as rhs = lhs ^ rhs.

Examples

use rug::ops::BitXorFrom;
struct U(u32);
impl BitXorFrom<u32> for U {
    fn bitxor_from(&mut self, lhs: u32) {
        self.0 = lhs ^ self.0;
    }
}
let mut u = U(0xf);
u.bitxor_from(0xff);
assert_eq!(u.0, 0xf0);

Required methods

fn bitxor_from(&mut self, lhs: Lhs)

Peforms the XOR operation.

Examples

use rug::Integer;
use rug::ops::BitXorFrom;
let mut rhs = Integer::from(0xf0);
rhs.bitxor_from(0x33);
// rhs = 0x33 ^ 0xf0
assert_eq!(rhs, 0xc3);
Loading content...

Implementations on Foreign Types

impl BitXorFrom<bool> for bool[src]

impl<'_> BitXorFrom<&'_ bool> for bool[src]

impl BitXorFrom<i8> for i8[src]

impl<'_> BitXorFrom<&'_ i8> for i8[src]

impl BitXorFrom<i16> for i16[src]

impl<'_> BitXorFrom<&'_ i16> for i16[src]

impl BitXorFrom<i32> for i32[src]

impl<'_> BitXorFrom<&'_ i32> for i32[src]

impl BitXorFrom<i64> for i64[src]

impl<'_> BitXorFrom<&'_ i64> for i64[src]

impl BitXorFrom<i128> for i128[src]

impl<'_> BitXorFrom<&'_ i128> for i128[src]

impl BitXorFrom<isize> for isize[src]

impl<'_> BitXorFrom<&'_ isize> for isize[src]

impl BitXorFrom<u8> for u8[src]

impl<'_> BitXorFrom<&'_ u8> for u8[src]

impl BitXorFrom<u16> for u16[src]

impl<'_> BitXorFrom<&'_ u16> for u16[src]

impl BitXorFrom<u32> for u32[src]

impl<'_> BitXorFrom<&'_ u32> for u32[src]

impl BitXorFrom<u64> for u64[src]

impl<'_> BitXorFrom<&'_ u64> for u64[src]

impl BitXorFrom<u128> for u128[src]

impl<'_> BitXorFrom<&'_ u128> for u128[src]

impl BitXorFrom<usize> for usize[src]

impl<'_> BitXorFrom<&'_ usize> for usize[src]

Loading content...

Implementors

impl BitXorFrom<i32> for Integer[src]

impl BitXorFrom<u32> for Integer[src]

impl BitXorFrom<Integer> for Integer[src]

impl<'_> BitXorFrom<&'_ i32> for Integer[src]

impl<'_> BitXorFrom<&'_ u32> for Integer[src]

impl<'_> BitXorFrom<&'_ Integer> for Integer[src]

Loading content...