pub struct PerformanceHints;
Expand description
Performance hints for critical code paths
Implementations§
Source§impl PerformanceHints
impl PerformanceHints
Sourcepub fn likely(cond: bool) -> bool
pub fn likely(cond: bool) -> bool
Hint that a branch is likely to be taken
Note: This function provides branch prediction hints on supported architectures. For Beta 1 stability, unstable intrinsics have been removed.
Sourcepub fn unlikely(cond: bool) -> bool
pub fn unlikely(cond: bool) -> bool
Hint that a branch is unlikely to be taken
Note: This function provides branch prediction hints on supported architectures. For Beta 1 stability, unstable intrinsics have been removed.
Sourcepub fn prefetch_read<T>(data: &T)
pub fn prefetch_read<T>(data: &T)
Prefetch data for read access
Sourcepub fn prefetch_write<T>(data: &mut T)
pub fn prefetch_write<T>(data: &mut T)
Prefetch data for write access
Sourcepub fn prefetch_with_locality<T>(data: &T, locality: Locality)
pub fn prefetch_with_locality<T>(data: &T, locality: Locality)
Advanced prefetch with locality hint
Sourcepub fn memory_fence()
pub fn memory_fence()
Memory fence for synchronization
Sourcepub fn flush_cache_line<T>(data: &T)
pub fn flush_cache_line<T>(data: &T)
Cache line flush for explicit cache management
Sourcepub fn cache_aware_copy<T: Copy>(src: &[T], dst: &mut [T])
pub fn cache_aware_copy<T: Copy>(src: &[T], dst: &mut [T])
Optimized memory copy with cache awareness
Sourcepub fn cache_aware_memset<T: Copy>(dst: &mut [T], value: T)
pub fn cache_aware_memset<T: Copy>(dst: &mut [T], value: T)
Optimized memory set with cache awareness
Auto Trait Implementations§
impl Freeze for PerformanceHints
impl RefUnwindSafe for PerformanceHints
impl Send for PerformanceHints
impl Sync for PerformanceHints
impl Unpin for PerformanceHints
impl UnwindSafe for PerformanceHints
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more