#[non_exhaustive]pub enum Locality {
L3,
L2,
L1,
}🔬This is a nightly-only experimental API. (
hint_prefetch #146941)Expand description
The expected temporal locality of a memory prefetch operation.
Locality expresses how likely the prefetched data is to be reused soon, and therefore which level of cache it should be brought into.
The locality is just a hint, and may be ignored on some targets or by the hardware.
Used with functions like prefetch_read and prefetch_write.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
L3
🔬This is a nightly-only experimental API. (
hint_prefetch #146941)Data is expected to be reused eventually.
Typically prefetches into L3 cache (if the CPU supports it).
L2
🔬This is a nightly-only experimental API. (
hint_prefetch #146941)Data is expected to be reused in the near future.
Typically prefetches into L2 cache.
L1
🔬This is a nightly-only experimental API. (
hint_prefetch #146941)Data is expected to be reused very soon.
Typically prefetches into L1 cache.
Trait Implementations§
impl Copy for Locality
impl Eq for Locality
impl StructuralPartialEq for Locality
Auto Trait Implementations§
impl Freeze for Locality
impl RefUnwindSafe for Locality
impl Send for Locality
impl Sync for Locality
impl Unpin for Locality
impl UnwindSafe for Locality
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