pub struct Guard {}Expand description
A Guard causes a task to end when it is dropped.
Implementations§
Source§impl Guard
impl Guard
Sourcepub fn replace(&self, task: &'static str)
pub fn replace(&self, task: &'static str)
Replace the last task pushed (or replaced) with a new one.
§Example
let _g = crude_profiler::push("test one");
std::thread::sleep(std::time::Duration::from_secs(2));
_g.replace("test two");
std::thread::sleep(std::time::Duration::from_secs(2));
println!("{}", crude_profiler::report());Trait Implementations§
Auto Trait Implementations§
impl Freeze for Guard
impl RefUnwindSafe for Guard
impl Send for Guard
impl Sync for Guard
impl Unpin for Guard
impl UnwindSafe for Guard
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