pub struct Profiler { /* private fields */ }Expand description
Performance profiler
Implementations§
Source§impl Profiler
impl Profiler
Sourcepub fn add_metric(&mut self, name: impl Into<String>, value: f64) -> Result<()>
pub fn add_metric(&mut self, name: impl Into<String>, value: f64) -> Result<()>
Add a custom metric to current session
Sourcepub fn sessions(&self) -> &[ProfileSession]
pub fn sessions(&self) -> &[ProfileSession]
Get all sessions
Sourcepub fn current_session(&self) -> Option<&ProfileSession>
pub fn current_session(&self) -> Option<&ProfileSession>
Get current session
Sourcepub fn export_json(&self) -> Result<String>
pub fn export_json(&self) -> Result<String>
Export sessions as JSON
Auto Trait Implementations§
impl Freeze for Profiler
impl RefUnwindSafe for Profiler
impl Send for Profiler
impl Sync for Profiler
impl Unpin for Profiler
impl UnsafeUnpin for Profiler
impl UnwindSafe for Profiler
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