[−][src]Trait bitlab::SingleBits
Defines a set of functions to get, set and clear single bits
Required methods
fn set_bit(self, bit_offset: u32) -> Result<Self, String> where
Self: Sized,
Self: Sized,
Sets a single bit and returns a Result object, which contains the modified variable
Parameters:
- bit_offset (u32) the offset of the bit to be set. Zero is the MOST significant bit.
fn get_bit(self, bit_offset: u32) -> Result<bool, String>
Tests a single bit and returns true or false in a Result object
On error, the Result object contains an error message. This may happen if the bit_offset is larger than the data source (bit_offset > variable size)
Parameters:
- bit_offset (u32) the offset of the bit to be set. Zero is the MOST significant bit.
fn clear_bit(self, bit_offset: u32) -> Result<Self, String> where
Self: Sized,
Self: Sized,
Clears a single bit and then returns a Result Object, which contains the modified varibale
Parameters:
- bit_offset (u32) the offset of the bit to be set. Zero is the MOST significant bit.
Implementations on Foreign Types
impl SingleBits for u8
[src]
fn set_bit(self, bit_offset: u32) -> Result<Self, String> where
Self: Sized,
[src]
Self: Sized,
fn get_bit(self, bit_offset: u32) -> Result<bool, String>
[src]
fn clear_bit(self, bit_offset: u32) -> Result<Self, String> where
Self: Sized,
[src]
Self: Sized,
impl SingleBits for i8
[src]
fn set_bit(self, bit_offset: u32) -> Result<Self, String> where
Self: Sized,
[src]
Self: Sized,
fn get_bit(self, bit_offset: u32) -> Result<bool, String>
[src]
fn clear_bit(self, bit_offset: u32) -> Result<Self, String> where
Self: Sized,
[src]
Self: Sized,
impl SingleBits for u16
[src]
fn set_bit(self, bit_offset: u32) -> Result<Self, String> where
Self: Sized,
[src]
Self: Sized,
fn get_bit(self, bit_offset: u32) -> Result<bool, String>
[src]
fn clear_bit(self, bit_offset: u32) -> Result<Self, String> where
Self: Sized,
[src]
Self: Sized,
impl SingleBits for i16
[src]
fn set_bit(self, bit_offset: u32) -> Result<Self, String> where
Self: Sized,
[src]
Self: Sized,
fn get_bit(self, bit_offset: u32) -> Result<bool, String>
[src]
fn clear_bit(self, bit_offset: u32) -> Result<Self, String> where
Self: Sized,
[src]
Self: Sized,
impl SingleBits for u32
[src]
fn set_bit(self, bit_offset: u32) -> Result<Self, String> where
Self: Sized,
[src]
Self: Sized,
fn get_bit(self, bit_offset: u32) -> Result<bool, String>
[src]
fn clear_bit(self, bit_offset: u32) -> Result<Self, String> where
Self: Sized,
[src]
Self: Sized,
impl SingleBits for i32
[src]
fn set_bit(self, bit_offset: u32) -> Result<Self, String> where
Self: Sized,
[src]
Self: Sized,
fn get_bit(self, bit_offset: u32) -> Result<bool, String>
[src]
fn clear_bit(self, bit_offset: u32) -> Result<Self, String> where
Self: Sized,
[src]
Self: Sized,
impl SingleBits for u64
[src]
fn set_bit(self, bit_offset: u32) -> Result<Self, String> where
Self: Sized,
[src]
Self: Sized,
fn get_bit(self, bit_offset: u32) -> Result<bool, String>
[src]
fn clear_bit(self, bit_offset: u32) -> Result<Self, String> where
Self: Sized,
[src]
Self: Sized,
impl SingleBits for i64
[src]
fn set_bit(self, bit_offset: u32) -> Result<Self, String> where
Self: Sized,
[src]
Self: Sized,
fn get_bit(self, bit_offset: u32) -> Result<bool, String>
[src]
fn clear_bit(self, bit_offset: u32) -> Result<Self, String> where
Self: Sized,
[src]
Self: Sized,