Trait deepmesa_collections::bitvec::traits::BitwiseClear[][src]

pub trait BitwiseClear {
    type Output;
    fn clear_lsb(self, n: u8) -> Self::Output;
fn clear_msb(self, n: u8) -> Self::Output;
fn clear_lsb_nth(self, n: u8) -> Self::Output;
fn clear_msb_nth(self, n: u8) -> Self::Output; }
Expand description

Returns a value with some bits of self cleared.

Associated Types

Required methods

Returns a value with the n LSB bits of self cleared.

Examples

use deepmesa::collections::bitvec::BitwiseClear;

let val:u8 = 0b1011_1100;
assert_eq!(val.clear_lsb(4), 0b1011_0000);

Returns a value with the n MSB bits of self cleared.

Examples

use deepmesa::collections::bitvec::BitwiseClear;

let val:u8 = 0b1011_1100;
assert_eq!(val.clear_msb(4), 0b0000_1100);

Returns a value with the nth LSB bit of self cleared.

Examples

use deepmesa::collections::bitvec::BitwiseClear;

let val:u8 = 0b1011_1100;
assert_eq!(val.clear_lsb_nth(3), 0b1011_0100);

Returns a value with the nth MSB bit of self cleared.

Examples

use deepmesa::collections::bitvec::BitwiseClear;

let val:u8 = 0b1011_1100;
assert_eq!(val.clear_msb_nth(3), 0b1010_1100);

Implementations on Foreign Types

Implementors