Struct proc_bitfield::example::BitRanges
source · pub struct BitRanges(pub u16);
Expand description
A bitfield showcasing how to specify bit ranges.
Tuple Fields§
§0: u16
Implementations§
source§impl BitRanges
impl BitRanges
pub fn whole_bitfield(&self) -> u16
pub fn with_whole_bitfield(self, value: u16) -> Self
pub fn set_whole_bitfield(&mut self, value: u16)
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)
Methods from Deref<Target = u16>§
pub const MIN: u16 = 0u16
pub const MAX: u16 = 65_535u16
pub const BITS: u32 = 16u32
Trait Implementations§
source§impl PartialEq for BitRanges
impl PartialEq for BitRanges
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, 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.