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§
Sourcefn 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 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.
Sourcefn stop<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: '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,
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.
Sourcefn wayland_display(&self) -> &str
fn wayland_display(&self) -> &str
Wayland display socket name (e.g. wayland-wd-abc12345).
Sourcefn runtime_dir(&self) -> &Path
fn runtime_dir(&self) -> &Path
Per-session XDG_RUNTIME_DIR, holding the Wayland socket and any supporting sockets like pipewire.