pub struct ProfilerMark { /* private fields */ }Expand description
A begin() marker — RAII guard that records the start
timestamp and the label so the matching end() call can
compute the elapsed time.
Created by ProfilerHandle::begin(label). Consume with
end() to push a ProfileEntry into the entries signal.
Dropping the marker without calling end() discards the
measurement silently (we don’t have a place to push a
half-finished entry, and panicking on drop is hostile).
Implementations§
Source§impl ProfilerMark
impl ProfilerMark
Sourcepub fn end(self)
pub fn end(self)
Closes the measurement started by begin() and pushes
the resulting ProfileEntry into the entries signal.
After calling end(), the marker is consumed and
cannot be reused. Calling end() twice is a no-op on
the second call — the marker is moved into the first
call, so the borrow checker prevents a second
invocation in well-typed code.
Source§impl ProfilerMark
impl ProfilerMark
pub fn get_label(&self) -> &String
pub fn get_mut_label(&mut self) -> &mut String
pub fn set_label(&mut self, val: String) -> &mut Self
pub fn get_started_ms(&self) -> &f64
pub fn get_mut_started_ms(&mut self) -> &mut f64
pub fn set_started_ms(&mut self, val: f64) -> &mut Self
pub fn get_entries(&self) -> &Signal<Vec<ProfileEntry>>
pub fn get_mut_entries(&mut self) -> &mut Signal<Vec<ProfileEntry>>
pub fn set_entries(&mut self, val: Signal<Vec<ProfileEntry>>) -> &mut Self
Source§impl ProfilerMark
impl ProfilerMark
Auto Trait Implementations§
impl Freeze for ProfilerMark
impl RefUnwindSafe for ProfilerMark
impl Send for ProfilerMark
impl Sync for ProfilerMark
impl Unpin for ProfilerMark
impl UnsafeUnpin for ProfilerMark
impl UnwindSafe for ProfilerMark
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