Struct proc_bitfield::example::ConstAccessors
source · pub struct ConstAccessors(pub u16);Expand description
A bitfield showcasing const fn support on nightly Rust.
Tuple Fields§
§0: u16Implementations§
source§impl ConstAccessors
impl ConstAccessors
pub const fn whole_bitfield(&self) -> u16
pub const fn with_whole_bitfield(self, value: u16) -> Self
pub const fn set_whole_bitfield(&mut self, value: u16)
pub const fn inclusive_range(&self) -> u8
pub const fn with_inclusive_range(self, value: u8) -> Self
pub const fn set_inclusive_range(&mut self, value: u8)
pub const fn exclusive_range(&self) -> u8
pub const fn with_exclusive_range(self, value: u8) -> Self
pub const fn set_exclusive_range(&mut self, value: u8)
pub const fn start_and_length(&self) -> u8
pub const fn with_start_and_length(self, value: u8) -> Self
pub const fn set_start_and_length(&mut self, value: u8)
pub const fn single_bit_inclusive_range(&self) -> u8
pub const fn with_single_bit_inclusive_range(self, value: u8) -> Self
pub const fn set_single_bit_inclusive_range(&mut self, value: u8)
pub const fn single_bit_exclusive_range(&self) -> u8
pub const fn with_single_bit_exclusive_range(self, value: u8) -> Self
pub const fn set_single_bit_exclusive_range(&mut self, value: u8)
pub const fn single_bit_start_and_length(&self) -> u8
pub const fn with_single_bit_start_and_length(self, value: u8) -> Self
pub const fn set_single_bit_start_and_length(&mut self, value: u8)
pub const fn flag(&self) -> bool
pub const fn with_flag(self, value: bool) -> Self
pub const fn set_flag(&mut self, value: bool)
Methods from Deref<Target = u16>§
Trait Implementations§
source§impl Clone for ConstAccessors
impl Clone for ConstAccessors
source§fn clone(&self) -> ConstAccessors
fn clone(&self) -> ConstAccessors
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for ConstAccessors
impl Debug for ConstAccessors
source§impl Deref for ConstAccessors
impl Deref for ConstAccessors
source§impl From<ConstAccessors> for u16
impl From<ConstAccessors> for u16
source§fn from(other: ConstAccessors) -> Self
fn from(other: ConstAccessors) -> Self
Converts to this type from the input type.
source§impl From<u16> for ConstAccessors
impl From<u16> for ConstAccessors
source§impl PartialEq<ConstAccessors> for ConstAccessors
impl PartialEq<ConstAccessors> for ConstAccessors
source§fn eq(&self, other: &ConstAccessors) -> bool
fn eq(&self, other: &ConstAccessors) -> bool
This method tests for
self and other values to be equal, and is used
by ==.