pub struct StatisticsMask(pub u32);Expand description
Bitmask identifying which statistics fields contain valid data.
A reader MUST check the relevant bit before using any statistics field. Fields whose bit is not set MUST be treated as unknown.
Bits 6–31 are reserved and MUST be 0. A reader MUST reject a descriptor
whose computed_mask has any reserved bit set.
§Examples
use hurray_core::descriptor::StatisticsMask;
let mask = StatisticsMask(StatisticsMask::NNZ_VALID | StatisticsMask::VALUE_RANGE_VALID);
assert!(mask.nnz_valid());
assert!(mask.value_range_valid());
assert!(!mask.sparsity_valid());Tuple Fields§
§0: u32Implementations§
Source§impl StatisticsMask
impl StatisticsMask
Sourcepub const SPARSITY_VALID: u32
pub const SPARSITY_VALID: u32
Bit 1: sparsity_ratio field is valid.
Sourcepub const VALUE_RANGE_VALID: u32
pub const VALUE_RANGE_VALID: u32
Bit 2: value_min, value_max, value_abs_max are valid.
Sourcepub const VALUE_STATS_VALID: u32
pub const VALUE_STATS_VALID: u32
Bit 3: value_mean, value_stddev are valid.
Sourcepub const NM_SPARSITY_VALID: u32
pub const NM_SPARSITY_VALID: u32
Bit 4: nm_n, nm_m are valid.
Sourcepub const NAN_INF_VALID: u32
pub const NAN_INF_VALID: u32
Bit 5: has_nan, has_inf are valid.
Sourcepub fn sparsity_valid(self) -> bool
pub fn sparsity_valid(self) -> bool
Returns true if the SPARSITY_VALID bit is set.
Sourcepub fn value_range_valid(self) -> bool
pub fn value_range_valid(self) -> bool
Returns true if the VALUE_RANGE_VALID bit is set.
Sourcepub fn value_stats_valid(self) -> bool
pub fn value_stats_valid(self) -> bool
Returns true if the VALUE_STATS_VALID bit is set.
Sourcepub fn nm_sparsity_valid(self) -> bool
pub fn nm_sparsity_valid(self) -> bool
Returns true if the NM_SPARSITY_VALID bit is set.
Sourcepub fn nan_inf_valid(self) -> bool
pub fn nan_inf_valid(self) -> bool
Returns true if the NAN_INF_VALID bit is set.
Trait Implementations§
Source§impl Clone for StatisticsMask
impl Clone for StatisticsMask
Source§fn clone(&self) -> StatisticsMask
fn clone(&self) -> StatisticsMask
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for StatisticsMask
Source§impl Debug for StatisticsMask
impl Debug for StatisticsMask
impl Eq for StatisticsMask
Source§impl PartialEq for StatisticsMask
impl PartialEq for StatisticsMask
Source§fn eq(&self, other: &StatisticsMask) -> bool
fn eq(&self, other: &StatisticsMask) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for StatisticsMask
Auto Trait Implementations§
impl Freeze for StatisticsMask
impl RefUnwindSafe for StatisticsMask
impl Send for StatisticsMask
impl Sync for StatisticsMask
impl Unpin for StatisticsMask
impl UnsafeUnpin for StatisticsMask
impl UnwindSafe for StatisticsMask
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