Struct rustc_data_structures::profiling::EventArgRecorder
source · pub struct EventArgRecorder<'p> {
profiler: &'p SelfProfiler,
args: SmallVec<[StringId; 2]>,
}
Expand description
A helper for recording costly arguments to self-profiling events. Used with
SelfProfilerRef::generic_activity_with_arg_recorder
.
Fields§
§profiler: &'p SelfProfiler
The SelfProfiler
used to intern the event arguments that users will ask to record.
args: SmallVec<[StringId; 2]>
The interned event arguments to be recorded in the generic activity event.
The most common case, when actually recording event arguments, is to have one argument. Then followed by recording two, in a couple places.
Implementations§
source§impl EventArgRecorder<'_>
impl EventArgRecorder<'_>
sourcepub fn record_arg<A>(&mut self, event_arg: A)
pub fn record_arg<A>(&mut self, event_arg: A)
Records a single argument within the current generic activity being profiled.
Note: when self-profiling with costly event arguments, at least one argument needs to be recorded. A panic will be triggered if that doesn’t happen.
Auto Trait Implementations§
impl<'p> Freeze for EventArgRecorder<'p>
impl<'p> !RefUnwindSafe for EventArgRecorder<'p>
impl<'p> Send for EventArgRecorder<'p>
impl<'p> Sync for EventArgRecorder<'p>
impl<'p> Unpin for EventArgRecorder<'p>
impl<'p> !UnwindSafe for EventArgRecorder<'p>
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 moresource§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 32 bytes