pub struct ProfileScope { /* private fields */ }Expand description
RAII guard for profiling a scope.
Creates a span on construction and records timing on drop.
When profiling is disabled (enabled() returns false), this is a no-op.
§Example
ⓘ
use reovim_kernel::debug::ProfileScope;
fn expensive_operation() {
let _scope = ProfileScope::new("expensive_operation", "mymodule");
// ... do work ...
} // timing recorded when _scope dropsImplementations§
Source§impl ProfileScope
impl ProfileScope
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProfileScope
impl RefUnwindSafe for ProfileScope
impl Send for ProfileScope
impl Sync for ProfileScope
impl Unpin for ProfileScope
impl UnsafeUnpin for ProfileScope
impl UnwindSafe for ProfileScope
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