Skip to main content

CompositorRuntime

Trait CompositorRuntime 

Source
pub trait CompositorRuntime: Send + Sync {
    // Required methods
    fn start<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        resolution: Option<&'life1 str>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn stop<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn id(&self) -> &str;
    fn wayland_display(&self) -> &str;
    fn runtime_dir(&self) -> &Path;
}
Expand description

Lifecycle of a headless compositor instance. A backend owns its compositor’s child processes (the compositor binary itself plus any supporting daemons like pipewire) and exposes the Wayland display name and runtime dir that client applications and sibling backends use.

Required Methods§

Source

fn start<'life0, 'life1, 'async_trait>( &'life0 mut self, resolution: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Spawn the compositor at the requested virtual-display size (or the backend default when None) and wait for it to be ready. After this returns successfully, wayland_display() and runtime_dir() must point at a live Wayland socket.

Source

fn stop<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Stop the compositor, tearing down all child processes and cleaning up the runtime directory. Safe to call on an un-started or already-stopped backend.

Source

fn id(&self) -> &str

Session identifier, used in log fields and default output paths.

Source

fn wayland_display(&self) -> &str

Wayland display socket name (e.g. wayland-wd-abc12345).

Source

fn runtime_dir(&self) -> &Path

Per-session XDG_RUNTIME_DIR, holding the Wayland socket and any supporting sockets like pipewire.

Implementors§