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

source

const CAPACITY: u32 = 63u32

🔬This is a nightly-only experimental API. (stdsimd)
source

const MASK: usize = 9_223_372_036_854_775_807usize

🔬This is a nightly-only experimental API. (stdsimd)
source

const INITIALIZED_BIT: usize = 9_223_372_036_854_775_808usize

🔬This is a nightly-only experimental API. (stdsimd)
source

const fn uninitialized() -> Self

🔬This is a nightly-only experimental API. (stdsimd)

Creates an uninitialized cache.

source

pub(crate) fn test(&self, bit: u32) -> Option<bool>

🔬This is a nightly-only experimental API. (stdsimd)

Is the bit in the cache set? Returns None if the cache has not been initialized.

source

fn initialize(&self, value: usize) -> usize

🔬This is a nightly-only experimental API. (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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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<T, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.