pub trait AsyncPropertySampler {
// Required methods
fn register(&self);
fn sample(
&self,
document_id: DocumentId,
generated_frame_id: Option<u64>,
) -> Vec<FrameMsg>;
fn deregister(&self);
}
Expand description
Allows callers to hook into the main render_backend loop and provide additional frame ops for generate_frame transactions. These functions are all called from the render backend thread.
Required Methods§
Sourcefn register(&self)
fn register(&self)
This is called exactly once, when the render backend thread is started and before it processes anything.
Sourcefn sample(
&self,
document_id: DocumentId,
generated_frame_id: Option<u64>,
) -> Vec<FrameMsg>
fn sample( &self, document_id: DocumentId, generated_frame_id: Option<u64>, ) -> Vec<FrameMsg>
This is called for each transaction with the generate_frame flag set (i.e. that will trigger a render). The list of frame messages returned are processed as though they were part of the original transaction.
Sourcefn deregister(&self)
fn deregister(&self)
This is called exactly once, when the render backend thread is about to terminate.