Skip to main content

DesktopExtension

Trait DesktopExtension 

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

Source

fn update(&mut self, _context: DesktopExtensionContext<'_>) -> Result<(), Error>

Synchronize extension state with the current runtime and native windows.

Source

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.

Source

fn suspended(&mut self) -> Result<(), Error>

Release or suspend native resources before the host surfaces suspend.

Source

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".

Implementors§