Skip to main content

AsyncPropertySampler

Trait AsyncPropertySampler 

Source
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§

Source

fn register(&self)

This is called exactly once, when the render backend thread is started and before it processes anything.

Source

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.

Source

fn deregister(&self)

This is called exactly once, when the render backend thread is about to terminate.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§