pub struct Table { /* private fields */ }
Expand description
Helper to print counters as a table in csv format.
§Example
use counters::*;
let counters = Counters::new();
let table = Table::new(&["foo", "bar", "meh"]);
for _ in 0..5 {
counters.event("bar");
}
counters.event("foo");
// "baz" isn't in the table labels, it will be ignored.
counters.event("baz");
table.add_row(&counters);
// Start a second row...
counters.reset_all();
counters.event("foo");
table.add_row(&counters);
// This prints the following to stdout:
// foo,bar,meh
// 1,5,0
// 1,0,0
table.print_to_stdout();
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Table
impl !RefUnwindSafe for Table
impl Send for Table
impl !Sync for Table
impl Unpin for Table
impl UnwindSafe for Table
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