pub trait RecorderSourceExt: Sized {
// Required methods
fn source(self, source: impl Source + 'static) -> Self;
fn on_recording_start(
self,
hook: impl FnOnce(&Dial9Handle) + Send + 'static,
) -> Self;
// Provided method
fn with_custom_events<F>(
self,
config: CustomEventsConfig,
callback: F,
) -> Self
where F: for<'a> FnMut(&mut CustomEventsContext<'a>) + Send + 'static { ... }
}Expand description
A builder that can register Sources.
Implemented by RecorderBuilder; the .with_*() perf-source sugar is
built on top of it.
Required Methods§
Sourcefn source(self, source: impl Source + 'static) -> Self
fn source(self, source: impl Source + 'static) -> Self
Register a Source with the underlying recording recorder.
Sourcefn on_recording_start(
self,
hook: impl FnOnce(&Dial9Handle) + Send + 'static,
) -> Self
fn on_recording_start( self, hook: impl FnOnce(&Dial9Handle) + Send + 'static, ) -> Self
Register a hook run once, with the live Dial9Handle, when the recorder
starts recording.
Provided Methods§
Sourcefn with_custom_events<F>(self, config: CustomEventsConfig, callback: F) -> Self
fn with_custom_events<F>(self, config: CustomEventsConfig, callback: F) -> Self
Register a callback that dial9 invokes on the flush thread at the config’s
interval to emit custom events. Sugar for source with a
CustomEventsSource. Not
tokio-coupled — works on the plain recorder and the tokio builder.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".