#[repr(transparent)]pub struct BitRanges(pub u32);
Expand description
A bitfield showcasing how to specify bit ranges.
Tuple Fields§
§0: u32
Implementations§
Source§impl BitRanges
impl BitRanges
pub fn whole_bitfield(&self) -> u32
pub fn with_whole_bitfield(self, value: u32) -> Self
pub fn set_whole_bitfield(&mut self, value: u32)
pub fn inclusive_range(&self) -> u8
pub fn with_inclusive_range(self, value: u8) -> Self
pub fn set_inclusive_range(&mut self, value: u8)
pub fn exclusive_range(&self) -> u8
pub fn with_exclusive_range(self, value: u8) -> Self
pub fn set_exclusive_range(&mut self, value: u8)
pub fn start_and_length(&self) -> u8
pub fn with_start_and_length(self, value: u8) -> Self
pub fn set_start_and_length(&mut self, value: u8)
pub fn single_bit_inclusive_range(&self) -> u8
pub fn with_single_bit_inclusive_range(self, value: u8) -> Self
pub fn set_single_bit_inclusive_range(&mut self, value: u8)
pub fn single_bit_exclusive_range(&self) -> u8
pub fn with_single_bit_exclusive_range(self, value: u8) -> Self
pub fn set_single_bit_exclusive_range(&mut self, value: u8)
pub fn single_bit_start_and_length(&self) -> u8
pub fn with_single_bit_start_and_length(self, value: u8) -> Self
pub fn set_single_bit_start_and_length(&mut self, value: u8)
pub fn flag(&self) -> bool
pub fn with_flag(self, value: bool) -> Self
pub fn set_flag(&mut self, value: bool)
pub fn pack_above(&self) -> u8
pub fn with_pack_above(self, value: u8) -> Self
pub fn set_pack_above(&mut self, value: u8)
pub fn single_bit_pack_above(&self) -> bool
pub fn with_single_bit_pack_above(self, value: bool) -> Self
pub fn set_single_bit_pack_above(&mut self, value: bool)
pub fn flag2(&self) -> bool
pub fn with_flag2(self, value: bool) -> Self
pub fn set_flag2(&mut self, value: bool)
pub fn pack_below(&self) -> u8
pub fn with_pack_below(self, value: u8) -> Self
pub fn set_pack_below(&mut self, value: u8)
pub fn single_bit_pack_below(&self) -> bool
pub fn with_single_bit_pack_below(self, value: bool) -> Self
pub fn set_single_bit_pack_below(&mut self, value: bool)
Trait Implementations§
impl Copy for BitRanges
impl Eq for BitRanges
impl StructuralPartialEq for BitRanges
Auto Trait Implementations§
impl Freeze for BitRanges
impl RefUnwindSafe for BitRanges
impl Send for BitRanges
impl Sync for BitRanges
impl Unpin for BitRanges
impl UnwindSafe for BitRanges
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, U> UnsafeFrom<U> for Twhere
U: Into<T>,
impl<T, U> UnsafeFrom<U> for Twhere
U: Into<T>,
Source§unsafe fn unsafe_from(other: U) -> T
unsafe fn unsafe_from(other: U) -> T
Calls U::into(other)
.
That is, this conversion is whatever the implementation of Into
<T> for U
chooses to
do.
Source§impl<T, U> UnsafeInto<U> for Twhere
U: UnsafeFrom<T>,
impl<T, U> UnsafeInto<U> for Twhere
U: UnsafeFrom<T>,
Source§unsafe fn unsafe_into(self) -> U
unsafe fn unsafe_into(self) -> U
Calls U::unsafe_from(self)
.
That is, this conversion is whatever the implementation of UnsafeFrom
<T> for U
chooses to do.