[][src]Trait algorithms_edu::data_structures::bit::Bit

pub trait Bit: Unsigned {
    pub fn set_bit(&mut self, pos: usize);
pub fn clear_bit(&mut self, pos: usize);
pub fn get_bit(&self, pos: usize) -> bool;
pub fn toggle_bit(&mut self, pos: usize);
pub fn set_all(&mut self, pos: usize);
pub fn is_power_of_two(&self) -> bool; }

Required methods

pub fn set_bit(&mut self, pos: usize)[src]

pub fn clear_bit(&mut self, pos: usize)[src]

pub fn get_bit(&self, pos: usize) -> bool[src]

pub fn toggle_bit(&mut self, pos: usize)[src]

pub fn set_all(&mut self, pos: usize)[src]

Returns a number with the first n bits set to 1

pub fn is_power_of_two(&self) -> bool[src]

Loading content...

Implementations on Foreign Types

impl Bit for u8[src]

impl Bit for u16[src]

impl Bit for u32[src]

impl Bit for u64[src]

impl Bit for u128[src]

impl Bit for usize[src]

Loading content...

Implementors

Loading content...