pub struct Guard {
slot: Slot,
started: usize,
}Expand description
スコープを抜けるときに自動で加算するガード。
引数の多い関数をラッパで包むとシグネチャの写経が必要になるので、 関数の先頭に 1 行置くだけで測れるようにする。
ⓘ
fn heavy(...) {
let _g = perf::Guard::new(perf::Slot::PaintText);
...
}Fields§
§slot: Slot§started: usizeImplementations§
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 UnsafeUnpin 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