#[repr(transparent)]#[doc(hidden)] pub struct BitElement<T = usize> {
pub elem: T,
}Expand description
§Unified Element Constructor
This type is a hack around the fact that Cell and AtomicUN all have
const fn new(val: Inner) -> Self; constructors, but the numberic fundamentals
do not. As such, the standard library does not provide a unified construction
syntax to turn an integer fundamental into the final type.
This provides a const fn BitElement::<_>::new(R) -> Self; function,
implemented only for the BitStore implementors that the crate provides, that
the constructor macros can use to turn integers into final values without using
mem::transmute. While transmute is acceptable in this case (the types
are all #[repr(transparent)]), it is still better avoided where possible.
As this is a macro assistant, it is publicly exposed, but is not public API. It has no purpose outside of the crate’s macros.
Fields§
§elem: TImplementations§
Source§impl BitElement<u8>
impl BitElement<u8>
Source§impl BitElement<Cell<u8>>
impl BitElement<Cell<u8>>
Source§impl BitElement<AtomicU8>
impl BitElement<AtomicU8>
Source§impl BitElement<u16>
impl BitElement<u16>
Source§impl BitElement<Cell<u16>>
impl BitElement<Cell<u16>>
Source§impl BitElement<AtomicU16>
impl BitElement<AtomicU16>
Source§impl BitElement<u32>
impl BitElement<u32>
Source§impl BitElement<Cell<u32>>
impl BitElement<Cell<u32>>
Source§impl BitElement<AtomicU32>
impl BitElement<AtomicU32>
Source§impl BitElement<u64>
impl BitElement<u64>
Source§impl BitElement<Cell<u64>>
impl BitElement<Cell<u64>>
Source§impl BitElement<AtomicU64>
impl BitElement<AtomicU64>
Source§impl BitElement<usize>
impl BitElement<usize>
Source§impl BitElement<Cell<usize>>
impl BitElement<Cell<usize>>
Source§impl BitElement<AtomicUsize>
impl BitElement<AtomicUsize>
Trait Implementations§
Source§impl<T: Clone> Clone for BitElement<T>
impl<T: Clone> Clone for BitElement<T>
Source§fn clone(&self) -> BitElement<T>
fn clone(&self) -> BitElement<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<T: Debug> Debug for BitElement<T>
impl<T: Debug> Debug for BitElement<T>
Source§impl<T: Default> Default for BitElement<T>
impl<T: Default> Default for BitElement<T>
Source§fn default() -> BitElement<T>
fn default() -> BitElement<T>
Source§impl<T: Eq> Eq for BitElement<T>
impl<T: Eq> Eq for BitElement<T>
#[doc(hidden)] fn assert_receiver_is_total_eq(&self)
Source§impl<T: Hash> Hash for BitElement<T>
impl<T: Hash> Hash for BitElement<T>
Source§impl<T: Ord> Ord for BitElement<T>
impl<T: Ord> Ord for BitElement<T>
Source§fn cmp(&self, other: &BitElement<T>) -> Ordering
fn cmp(&self, other: &BitElement<T>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<T: PartialEq> PartialEq for BitElement<T>
impl<T: PartialEq> PartialEq for BitElement<T>
Source§impl<T: PartialOrd> PartialOrd for BitElement<T>
impl<T: PartialOrd> PartialOrd for BitElement<T>
Source§fn partial_cmp(&self, other: &BitElement<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &BitElement<T>) -> Option<Ordering>
Source§#[doc(hidden)] fn __chaining_lt(&self, other: &Rhs) -> ControlFlow<bool>
#[doc(hidden)] fn __chaining_lt(&self, other: &Rhs) -> ControlFlow<bool>
partial_ord_chaining_methods)self == other, returns ControlFlow::Continue(()).
Otherwise, returns ControlFlow::Break(self < other). Read moreSource§#[doc(hidden)] fn __chaining_le(&self, other: &Rhs) -> ControlFlow<bool>
#[doc(hidden)] fn __chaining_le(&self, other: &Rhs) -> ControlFlow<bool>
partial_ord_chaining_methods)__chaining_lt, but for <= instead of <.Source§#[doc(hidden)] fn __chaining_gt(&self, other: &Rhs) -> ControlFlow<bool>
#[doc(hidden)] fn __chaining_gt(&self, other: &Rhs) -> ControlFlow<bool>
partial_ord_chaining_methods)__chaining_lt, but for > instead of <.Source§#[doc(hidden)] fn __chaining_ge(&self, other: &Rhs) -> ControlFlow<bool>
#[doc(hidden)] fn __chaining_ge(&self, other: &Rhs) -> ControlFlow<bool>
partial_ord_chaining_methods)__chaining_lt, but for >= instead of <.