pub struct LongSpanBuilder(/* private fields */);Expand description
Builds a LongSpan for annotating a long timespan.
Implementations§
Source§impl LongSpanBuilder
impl LongSpanBuilder
Sourcepub fn new(name: &'static str) -> Self
pub fn new(name: &'static str) -> Self
Constructs a new LongSpanBuilder with the given name.
The name should ordinarily be a short static string indicating what happens during the span. The Firefox Profiler’s marker chart view shows all the spans 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 span.
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(self, tooltip: impl Into<String>) -> Self
pub fn with_tooltip(self, tooltip: impl Into<String>) -> Self
Adds tooltip to this span.
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.
Sourcepub fn with_start(self, start: Instant) -> Self
pub fn with_start(self, start: Instant) -> Self
Sets the starting time for this span to start. The default starting
time is when the LongSpanBuilder was constructed, so this is only
useful if it’s easier to create the span just before recording it.
Auto Trait Implementations§
impl Freeze for LongSpanBuilder
impl RefUnwindSafe for LongSpanBuilder
impl Send for LongSpanBuilder
impl Sync for LongSpanBuilder
impl Unpin for LongSpanBuilder
impl UnsafeUnpin for LongSpanBuilder
impl UnwindSafe for LongSpanBuilder
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