mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-06 03:20:26 +00:00
25 lines
682 B
Rust
25 lines
682 B
Rust
//! `NcStats`
|
|
|
|
use crate::Notcurses;
|
|
|
|
/// notcurses runtime statistics
|
|
pub type NcStats = crate::bindings::ffi::ncstats;
|
|
|
|
/// # `NcStats` Methods.
|
|
impl NcStats {
|
|
/// Allocates an NcStats object.
|
|
pub fn new<'a>(nc: &'a Notcurses) -> &'a mut Self {
|
|
unsafe { &mut *crate::notcurses_stats_alloc(nc) }
|
|
}
|
|
|
|
/// Acquires an atomic snapshot of the Notcurses object's stats.
|
|
pub fn stats(&mut self, nc: &mut Notcurses) {
|
|
unsafe { crate::notcurses_stats(nc, self) }
|
|
}
|
|
|
|
/// Resets all cumulative stats (immediate ones are not reset).
|
|
pub fn reset(&mut self, nc: &mut Notcurses) {
|
|
unsafe { crate::notcurses_stats_reset(nc, self) }
|
|
}
|
|
}
|