#[repr(i32)]pub enum Unit {
Unspecified = 0,
Nanoseconds = 1,
CpuCycles = 2,
Instructions = 3,
Bytes = 4,
PageFaults = 5,
CacheMisses = 6,
CacheReferences = 7,
BranchMisses = 8,
Count = 9,
}Expand description
The unit a CounterDescriptor’s values are expressed in. Append-only: new units may be added, but existing values are never renumbered or repurposed. If none of these fit, set CounterDescriptor.unit_str instead.
Variants§
Unspecified = 0
Nanoseconds = 1
CpuCycles = 2
Instructions = 3
Bytes = 4
PageFaults = 5
CacheMisses = 6
CacheReferences = 7
BranchMisses = 8
Count = 9
Implementations§
Source§impl Unit
impl Unit
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
impl Copy for Unit
impl Eq for Unit
Source§impl Ord for Unit
impl Ord for Unit
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Unit
impl PartialOrd for Unit
impl StructuralPartialEq for Unit
Auto Trait Implementations§
impl Freeze for Unit
impl RefUnwindSafe for Unit
impl Send for Unit
impl Sync for Unit
impl Unpin for Unit
impl UnsafeUnpin for Unit
impl UnwindSafe for Unit
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