[][src]Struct fluvio_system_util::counters::CounterTable

pub struct CounterTable<T, C> {
    pub columns: BTreeMap<C, Column>,
    pub rows: RwLock<BTreeMap<T, BTreeMap<C, u32>>>,
}

Fields

columns: BTreeMap<C, Column>rows: RwLock<BTreeMap<T, BTreeMap<C, u32>>>

Implementations

impl<T, C> CounterTable<T, C> where
    C: Ord + Clone,
    T: Ord
[src]

pub fn with_columns(self, columns: Vec<(C, &'static str, bool)>) -> Self[src]

builder pattern to add columns

pub fn add_row(&self, row_id: T)[src]

create a row and add counter columns

pub fn remove_row(&self, row_id: &T)[src]

remove counter row

pub fn row_count(&self) -> usize[src]

number of rows

pub fn inc_counter(&self, row_id: &T, column_id: C)[src]

increment counter

pub fn set_counter(&self, row_id: &T, column_id: C, val: u32)[src]

set counter

pub fn reset_counters(&self)[src]

reset all counters

pub fn header_fmt(&self) -> String[src]

column headers in string format (center justified, min 10 spaces)

pub fn values_fmt(&self, row_id: T) -> String[src]

format values in string format (center justified to column header - min 10 spaces)

Trait Implementations

impl<T: Debug, C: Debug> Debug for CounterTable<T, C>[src]

impl<T, C> Default for CounterTable<T, C> where
    C: Ord,
    T: Ord
[src]

impl<T, C> PartialEq<CounterTable<T, C>> for CounterTable<T, C> where
    C: PartialEq,
    T: PartialEq
[src]

Auto Trait Implementations

impl<T, C> RefUnwindSafe for CounterTable<T, C> where
    C: RefUnwindSafe
[src]

impl<T, C> Send for CounterTable<T, C> where
    C: Send,
    T: Send
[src]

impl<T, C> Sync for CounterTable<T, C> where
    C: Send + Sync,
    T: Send + Sync
[src]

impl<T, C> Unpin for CounterTable<T, C>[src]

impl<T, C> UnwindSafe for CounterTable<T, C> where
    C: RefUnwindSafe
[src]

Blanket Implementations

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

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

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

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

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<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<V, T> VZip<V> for T where
    V: MultiLane<T>,