pub struct HardwareDetector { /* private fields */ }Expand description
Hardware capability detection
Implementations§
Source§impl HardwareDetector
impl HardwareDetector
Sourcepub fn logical_cores(&self) -> usize
pub fn logical_cores(&self) -> usize
Get number of logical CPU cores (including hyperthreading)
Sourcepub fn cpu_architecture(&self) -> &str
pub fn cpu_architecture(&self) -> &str
Get CPU architecture
Sourcepub fn cpu_vendor(&self) -> &str
pub fn cpu_vendor(&self) -> &str
Get CPU vendor
Sourcepub fn total_memory(&self) -> u64
pub fn total_memory(&self) -> u64
Get total system memory in bytes
Sourcepub fn available_memory(&self) -> u64
pub fn available_memory(&self) -> u64
Get available system memory in bytes
Sourcepub fn has_avx512(&self) -> bool
pub fn has_avx512(&self) -> bool
Check if CPU supports AVX-512 instructions
Sourcepub fn l3_cache_size_kb(&self) -> Option<u32>
pub fn l3_cache_size_kb(&self) -> Option<u32>
Get L3 cache size in KB
Sourcepub fn cache_line_size(&self) -> Option<u32>
pub fn cache_line_size(&self) -> Option<u32>
Get cache line size in bytes
Sourcepub fn cpu_features(&self) -> &[String]
pub fn cpu_features(&self) -> &[String]
Get all CPU features
Trait Implementations§
Source§impl Clone for HardwareDetector
impl Clone for HardwareDetector
Source§fn clone(&self) -> HardwareDetector
fn clone(&self) -> HardwareDetector
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HardwareDetector
impl Debug for HardwareDetector
Auto Trait Implementations§
impl Freeze for HardwareDetector
impl RefUnwindSafe for HardwareDetector
impl Send for HardwareDetector
impl Sync for HardwareDetector
impl Unpin for HardwareDetector
impl UnwindSafe for HardwareDetector
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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