Struct std_detect::detect::cache::Cache
source · struct Cache(AtomicUsize);
🔬This is a nightly-only experimental API. (
stdsimd
)Expand description
Feature cache with capacity for size_of::<usize::MAX>() * 8 - 1
features.
Note: 0 is used to represent an uninitialized cache, and (at least) the most significant bit is set on any cache which has been initialized.
Note: we use Relaxed
atomic operations, because we are only interested in
the effects of operations on a single memory location. That is, we only need
“modification order”, and not the full-blown “happens before”.
Tuple Fields§
§0: AtomicUsize
🔬This is a nightly-only experimental API. (
stdsimd
)Implementations§
source§impl Cache
impl Cache
const CAPACITY: u32 = 63u32
🔬This is a nightly-only experimental API. (
stdsimd
)const MASK: usize = 9_223_372_036_854_775_807usize
🔬This is a nightly-only experimental API. (
stdsimd
)const INITIALIZED_BIT: usize = 9_223_372_036_854_775_808usize
🔬This is a nightly-only experimental API. (
stdsimd
)sourceconst fn uninitialized() -> Self
🔬This is a nightly-only experimental API. (stdsimd
)
const fn uninitialized() -> Self
stdsimd
)Creates an uninitialized cache.
sourcepub(crate) fn test(&self, bit: u32) -> Option<bool>
🔬This is a nightly-only experimental API. (stdsimd
)
pub(crate) fn test(&self, bit: u32) -> Option<bool>
stdsimd
)Is the bit
in the cache set? Returns None
if the cache has not been initialized.
sourcefn initialize(&self, value: usize) -> usize
🔬This is a nightly-only experimental API. (stdsimd
)
fn initialize(&self, value: usize) -> usize
stdsimd
)Initializes the cache.
Auto Trait Implementations§
impl RefUnwindSafe for Cache
impl Send for Cache
impl Sync for Cache
impl Unpin for Cache
impl UnwindSafe for Cache
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