[][src]Struct ccache_stats_reader::CacheFieldData

pub struct CacheFieldData { /* fields omitted */ }

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]

impl Clone for CacheFieldData[src]

impl Copy for CacheFieldData[src]

impl Debug for CacheFieldData[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]