Skip to main content

BitRanges

Struct BitRanges 

Source
#[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

Source

pub fn whole_bitfield(&self) -> u32

Source

pub fn with_whole_bitfield(self, value: u32) -> Self

Source

pub fn set_whole_bitfield(&mut self, value: u32)

Source

pub fn inclusive_range(&self) -> u8

Source

pub fn with_inclusive_range(self, value: u8) -> Self

Source

pub fn set_inclusive_range(&mut self, value: u8)

Source

pub fn exclusive_range(&self) -> u8

Source

pub fn with_exclusive_range(self, value: u8) -> Self

Source

pub fn set_exclusive_range(&mut self, value: u8)

Source

pub fn start_and_length(&self) -> u8

Source

pub fn with_start_and_length(self, value: u8) -> Self

Source

pub fn set_start_and_length(&mut self, value: u8)

Source

pub fn single_bit_inclusive_range(&self) -> u8

Source

pub fn with_single_bit_inclusive_range(self, value: u8) -> Self

Source

pub fn set_single_bit_inclusive_range(&mut self, value: u8)

Source

pub fn single_bit_exclusive_range(&self) -> u8

Source

pub fn with_single_bit_exclusive_range(self, value: u8) -> Self

Source

pub fn set_single_bit_exclusive_range(&mut self, value: u8)

Source

pub fn single_bit_start_and_length(&self) -> u8

Source

pub fn with_single_bit_start_and_length(self, value: u8) -> Self

Source

pub fn set_single_bit_start_and_length(&mut self, value: u8)

Source

pub fn flag(&self) -> bool

Source

pub fn with_flag(self, value: bool) -> Self

Source

pub fn set_flag(&mut self, value: bool)

Source

pub fn pack_above(&self) -> u8

Source

pub fn with_pack_above(self, value: u8) -> Self

Source

pub fn set_pack_above(&mut self, value: u8)

Source

pub fn single_bit_pack_above(&self) -> bool

Source

pub fn with_single_bit_pack_above(self, value: bool) -> Self

Source

pub fn set_single_bit_pack_above(&mut self, value: bool)

Source

pub fn flag2(&self) -> bool

Source

pub fn with_flag2(self, value: bool) -> Self

Source

pub fn set_flag2(&mut self, value: bool)

Source

pub fn pack_below(&self) -> u8

Source

pub fn with_pack_below(self, value: u8) -> Self

Source

pub fn set_pack_below(&mut self, value: u8)

Source

pub fn single_bit_pack_below(&self) -> bool

Source

pub fn with_single_bit_pack_below(self, value: bool) -> Self

Source

pub fn set_single_bit_pack_below(&mut self, value: bool)

Methods from Deref<Target = u32>§

1.43.0 · Source

pub const MIN: u32 = 0

1.43.0 · Source

pub const MAX: u32

1.53.0 · Source

pub const BITS: u32

Trait Implementations§

Source§

impl Bitfield for BitRanges

Source§

type Storage = u32

This bitfield’s storage type.
Source§

impl Clone for BitRanges

Source§

fn clone(&self) -> BitRanges

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for BitRanges

Source§

impl Debug for BitRanges

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Deref for BitRanges

Source§

type Target = u32

The resulting type after dereferencing.
Source§

fn deref(&self) -> &u32

Dereferences the value.
Source§

impl Eq for BitRanges

Source§

impl From<BitRanges> for u32

Source§

fn from(other: BitRanges) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for BitRanges

Source§

fn from(other: u32) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for BitRanges

Source§

fn eq(&self, other: &BitRanges) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for BitRanges

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T, U> UnsafeFrom<U> for T
where U: Into<T>,

Source§

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 T
where U: UnsafeFrom<T>,

Source§

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.