Trait rug::ops::NotAssign

source ·
pub trait NotAssign {
    fn not_assign(&mut self);
}
Expand description

Compound bitwise complement and assignement.

Examples

use rug::ops::NotAssign;
struct I(i32);
impl NotAssign for I {
    fn not_assign(&mut self) {
        self.0 = !self.0;
    }
}
let mut i = I(42);
i.not_assign();
assert_eq!(i.0, !42);

Required Methods

Peforms the complement.

Examples
use rug::ops::NotAssign;
use rug::Integer;
let mut i = Integer::from(-42);
i.not_assign();
assert_eq!(i, !-42);

Implementations on Foreign Types

Implementors