pub trait DesktopExtension: Debug {
// Provided methods
fn update(
&mut self,
_context: DesktopExtensionContext<'_>,
) -> Result<(), Error> { ... }
fn frame_presented(
&mut self,
_context: DesktopExtensionContext<'_>,
_frame: DesktopFramePresented,
) -> Result<(), Error> { ... }
fn suspended(&mut self) -> Result<(), Error> { ... }
fn poll_interval(&self) -> Option<Duration> { ... }
}Expand description
Optional integration driven alongside SUI’s desktop event loop.
Extensions are updated on the UI thread after runtime work and window synchronization. They are intended for native child surfaces and other platform-owned objects that must follow SUI window and widget lifecycles without becoming dependencies of the renderer-neutral runtime.
Provided Methods§
Sourcefn update(&mut self, _context: DesktopExtensionContext<'_>) -> Result<(), Error>
fn update(&mut self, _context: DesktopExtensionContext<'_>) -> Result<(), Error>
Synchronize extension state with the current runtime and native windows.
Sourcefn frame_presented(
&mut self,
_context: DesktopExtensionContext<'_>,
_frame: DesktopFramePresented,
) -> Result<(), Error>
fn frame_presented( &mut self, _context: DesktopExtensionContext<'_>, _frame: DesktopFramePresented, ) -> Result<(), Error>
Observe a successfully submitted content frame. The timestamp is captured immediately after the renderer returns from presentation, before diagnostics or extension work. This is not a physical scanout timestamp.
Sourcefn suspended(&mut self) -> Result<(), Error>
fn suspended(&mut self) -> Result<(), Error>
Release or suspend native resources before the host surfaces suspend.
Sourcefn poll_interval(&self) -> Option<Duration>
fn poll_interval(&self) -> Option<Duration>
Request a maximum idle interval while the extension has work that must be pumped even when SUI itself has no scheduled wakeup.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".