pub trait ProfileState: Send + Sync {
// Required methods
fn record_new(
&mut self,
volume: &Arc<FxVolume>,
recording_handle: Box<dyn RecordingHandle>,
) -> Box<dyn Recorder>;
fn replay_profile(
&mut self,
handle: Box<dyn ReadObjectHandle>,
volume: Arc<FxVolume>,
guard: ActiveGuard,
);
fn wait_for_replay_to_finish<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn wait_for_recording_to_finish<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Holds the current profile recording and/or replay state, and provides methods for state transitions.
Required Methods§
Sourcefn record_new(
&mut self,
volume: &Arc<FxVolume>,
recording_handle: Box<dyn RecordingHandle>,
) -> Box<dyn Recorder>
fn record_new( &mut self, volume: &Arc<FxVolume>, recording_handle: Box<dyn RecordingHandle>, ) -> Box<dyn Recorder>
Creates a new recording and returns the Recorder object to record to. The recording
finalizes when the associated Recorder is dropped. Stops any recording currently in
progress.
Sourcefn replay_profile(
&mut self,
handle: Box<dyn ReadObjectHandle>,
volume: Arc<FxVolume>,
guard: ActiveGuard,
)
fn replay_profile( &mut self, handle: Box<dyn ReadObjectHandle>, volume: Arc<FxVolume>, guard: ActiveGuard, )
Reads given handle to parse a profile and replay it by requesting pages via ZX_VMO_OP_PREFETCH in blocking background threads. Stops any replay currently in progress.
Sourcefn wait_for_replay_to_finish<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn wait_for_replay_to_finish<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Waits for replay to finish, but does not drop the cache. The cache will be dropped when the ProfileState impl is dropped. This is fine to call multiple times.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".