pub struct Event(/* private fields */);Expand description
Implementations§
Source§impl Event
impl Event
Sourcepub fn new(name: &'static str) -> Self
pub fn new(name: &'static str) -> Self
Constructs a new Event with the given name.
Event does nothing when markers are not being captured.
The name should ordinarily be a short static string indicating what the event did. The Firefox Profiler’s marker chart view shows all the events in a thread with the same name and category on a single horizontal timeline (unless that would cause overlaps).
Sourcepub fn with_category(self, category: &'static str) -> Self
pub fn with_category(self, category: &'static str) -> Self
Adds category to this event.
The Firefox Profiler’s marker chart view groups the markers in each category and labels them with the category name.
The default category is “Other”.
Sourcepub fn with_tooltip<F>(self, tooltip: F) -> Self
pub fn with_tooltip<F>(self, tooltip: F) -> Self
Evaluates tooltip and adds it to this event.
The Firefox Profiler shows the given tooltip in the marker chart timeline (often truncated) and on hover, and as “details” in the marker table view.
tooltip is only evaluated if capturing is active.
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnsafeUnpin for Event
impl UnwindSafe for Event
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more