pub struct Level(/* private fields */);Expand description
An opaque representation of an Architecture’s capability level.
Level allows comparing the relative capabilities of different architectures
without requiring an instance of the architecture type. This is useful for
compile-time checks against crate::ARCH where constructing architecture
types like x86_64::V3 would require unsafe.
Levels are totally ordered within an ISA family, with greater values indicating
more capable instruction sets. Scalar is always the lowest level.
§Examples
Checking if the compile-time architecture meets a minimum capability:
#[cfg(target_arch = "x86_64")]
use diskann_wide::{Architecture, arch};
// Check at compile time whether we were built with AVX2+ support.
#[cfg(target_arch = "x86_64")]
let _meets_v3 = arch::Current::level() >= arch::x86_64::V3::level();Trait Implementations§
Source§impl PartialOrd for Level
impl PartialOrd for Level
impl Copy for Level
impl StructuralPartialEq for Level
Auto Trait Implementations§
impl Freeze for Level
impl RefUnwindSafe for Level
impl Send for Level
impl Sync for Level
impl Unpin for Level
impl UnsafeUnpin for Level
impl UnwindSafe for Level
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