Trait rug::ops::BitOrFrom

source ·
pub trait BitOrFrom<Lhs = Self> {
    // Required method
    fn bitor_from(&mut self, lhs: Lhs);
}
Expand description

Compound bitwise OR and assignment to the rhs operand.

rhs.bitor_from(lhs) has the same effect as rhs = lhs | rhs.

§Examples

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

Required Methods§

source

fn bitor_from(&mut self, lhs: Lhs)

Peforms the OR operation.

§Examples
use rug::ops::BitOrFrom;
use rug::Integer;
let mut rhs = Integer::from(0xf0);
rhs.bitor_from(0x33);
// rhs = 0x33 | 0xf0
assert_eq!(rhs, 0xf3);

Implementations on Foreign Types§

source§

impl BitOrFrom for bool

source§

fn bitor_from(&mut self, lhs: bool)

source§

impl BitOrFrom for i8

source§

fn bitor_from(&mut self, lhs: i8)

source§

impl BitOrFrom for i16

source§

fn bitor_from(&mut self, lhs: i16)

source§

impl BitOrFrom for i32

source§

fn bitor_from(&mut self, lhs: i32)

source§

impl BitOrFrom for i64

source§

fn bitor_from(&mut self, lhs: i64)

source§

impl BitOrFrom for i128

source§

fn bitor_from(&mut self, lhs: i128)

source§

impl BitOrFrom for isize

source§

fn bitor_from(&mut self, lhs: isize)

source§

impl BitOrFrom for u8

source§

fn bitor_from(&mut self, lhs: u8)

source§

impl BitOrFrom for u16

source§

fn bitor_from(&mut self, lhs: u16)

source§

impl BitOrFrom for u32

source§

fn bitor_from(&mut self, lhs: u32)

source§

impl BitOrFrom for u64

source§

fn bitor_from(&mut self, lhs: u64)

source§

impl BitOrFrom for u128

source§

fn bitor_from(&mut self, lhs: u128)

source§

impl BitOrFrom for usize

source§

fn bitor_from(&mut self, lhs: usize)

source§

impl BitOrFrom<&bool> for bool

source§

fn bitor_from(&mut self, lhs: &bool)

source§

impl BitOrFrom<&i8> for i8

source§

fn bitor_from(&mut self, lhs: &i8)

source§

impl BitOrFrom<&i16> for i16

source§

fn bitor_from(&mut self, lhs: &i16)

source§

impl BitOrFrom<&i32> for i32

source§

fn bitor_from(&mut self, lhs: &i32)

source§

impl BitOrFrom<&i64> for i64

source§

fn bitor_from(&mut self, lhs: &i64)

source§

impl BitOrFrom<&i128> for i128

source§

fn bitor_from(&mut self, lhs: &i128)

source§

impl BitOrFrom<&isize> for isize

source§

fn bitor_from(&mut self, lhs: &isize)

source§

impl BitOrFrom<&u8> for u8

source§

fn bitor_from(&mut self, lhs: &u8)

source§

impl BitOrFrom<&u16> for u16

source§

fn bitor_from(&mut self, lhs: &u16)

source§

impl BitOrFrom<&u32> for u32

source§

fn bitor_from(&mut self, lhs: &u32)

source§

impl BitOrFrom<&u64> for u64

source§

fn bitor_from(&mut self, lhs: &u64)

source§

impl BitOrFrom<&u128> for u128

source§

fn bitor_from(&mut self, lhs: &u128)

source§

impl BitOrFrom<&usize> for usize

source§

fn bitor_from(&mut self, lhs: &usize)

Implementors§