[−][src]Struct ccache_stats_reader::CacheFieldData
A hash-like interface for accessing values using Enums as keys.
This struct is basically a cosmetic wrapper that provides a bit of compile time safety, improved performance over HashMap access, improved performance over HashMap memory utilization, while still having most of the same conveniences.
use ccache_stats_reader::{CacheField, CacheFieldData}; let mut data : CacheFieldData = Default::default(); data.set_field(CacheField::CacheHitDir, 32); assert_eq!(data.get_field(CacheField::CacheHitCpp), 0);
Methods
impl CacheFieldData
[src]
pub fn set_field(&mut self, f: CacheField, v: u64)
[src]
Set the stored value for the CacheField specified
let mut data: CacheFieldData = Default::default(); data.set_field(CacheField::CacheHitDir, 32);
pub fn get_field(&self, f: CacheField) -> u64
[src]
Get a stored value for the CacheField specified
assert_eq!(data.get_field(CacheField::CacheHitDir), 32);
Trait Implementations
impl Default for CacheFieldData
[src]
fn default() -> CacheFieldData
[src]
impl Clone for CacheFieldData
[src]
fn clone(&self) -> CacheFieldData
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for CacheFieldData
[src]
impl Debug for CacheFieldData
[src]
Auto Trait Implementations
impl Send for CacheFieldData
impl Unpin for CacheFieldData
impl Sync for CacheFieldData
impl UnwindSafe for CacheFieldData
impl RefUnwindSafe for CacheFieldData
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,