Trait rug::ops::BitAndFrom[][src]

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

Compound bitwise AND and assignment to the rhs operand.

rhs.bitand_from(lhs) has the same effect as rhs = lhs & rhs.

Examples

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

Required methods

fn bitand_from(&mut self, lhs: Lhs)[src]

Peforms the AND operation.

Examples

use rug::{ops::BitAndFrom, Integer};
let mut rhs = Integer::from(0xf0);
rhs.bitand_from(0x33);
// rhs = 0x33 & 0xf0
assert_eq!(rhs, 0x30);
Loading content...

Implementations on Foreign Types

impl BitAndFrom<bool> for bool[src]

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

impl BitAndFrom<i8> for i8[src]

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

impl BitAndFrom<i16> for i16[src]

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

impl BitAndFrom<i32> for i32[src]

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

impl BitAndFrom<i64> for i64[src]

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

impl BitAndFrom<i128> for i128[src]

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

impl BitAndFrom<isize> for isize[src]

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

impl BitAndFrom<u8> for u8[src]

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

impl BitAndFrom<u16> for u16[src]

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

impl BitAndFrom<u32> for u32[src]

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

impl BitAndFrom<u64> for u64[src]

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

impl BitAndFrom<u128> for u128[src]

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

impl BitAndFrom<usize> for usize[src]

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

Loading content...

Implementors

impl BitAndFrom<&'_ i8> for Integer[src]

impl BitAndFrom<&'_ i16> for Integer[src]

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

impl BitAndFrom<&'_ i64> for Integer[src]

impl BitAndFrom<&'_ i128> for Integer[src]

impl BitAndFrom<&'_ u8> for Integer[src]

impl BitAndFrom<&'_ u16> for Integer[src]

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

impl BitAndFrom<&'_ u64> for Integer[src]

impl BitAndFrom<&'_ u128> for Integer[src]

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

impl BitAndFrom<i8> for Integer[src]

impl BitAndFrom<i16> for Integer[src]

impl BitAndFrom<i32> for Integer[src]

impl BitAndFrom<i64> for Integer[src]

impl BitAndFrom<i128> for Integer[src]

impl BitAndFrom<u8> for Integer[src]

impl BitAndFrom<u16> for Integer[src]

impl BitAndFrom<u32> for Integer[src]

impl BitAndFrom<u64> for Integer[src]

impl BitAndFrom<u128> for Integer[src]

impl BitAndFrom<Integer> for Integer[src]

Loading content...