pub trait PresentListener: Send + Sync {
// Required methods
fn queued(&self, window: u64, present: u64);
fn resolved(&self, window: u64, present: u64, outcome: PresentOutcome);
// Provided method
fn refresh(&self) { ... }
}Expand description
Hears window presents; see the module docs.
Required Methods§
Sourcefn queued(&self, window: u64, present: u64)
fn queued(&self, window: u64, present: u64)
On the presenting thread, after the present was queued and before it can be resolved.
window is the native handle: the HWND on Windows, the view’s CAMetalLayer on macOS.
Sourcefn resolved(&self, window: u64, present: u64, outcome: PresentOutcome)
fn resolved(&self, window: u64, present: u64, outcome: PresentOutcome)
Once per queued present, in present order per window.
Provided Methods§
Sourcefn refresh(&self)
fn refresh(&self)
On Windows, once per refresh while feedback is wanted, after that refresh’s
Self::resolved calls: from the vsync thread, after it asked the windows to paint, or
with set_feedback_after_composition from a thread of its own.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".