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)where
A: Borrow<str> + Into<String>,
pub fn record_arg<A>(&mut self, event_arg: A)where A: Borrow<str> + Into<String>,
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> !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
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