pub struct MutterCompositor { /* private fields */ }Expand description
Headless mutter instance.
Implementations§
Source§impl MutterCompositor
impl MutterCompositor
Sourcepub fn new() -> Self
pub fn new() -> Self
Construct but do not start. Generates the session id and computes where the Wayland socket and runtime dir will live. No I/O.
Sourcepub fn state(&self) -> Arc<MutterState>
pub fn state(&self) -> Arc<MutterState>
Returns the shared Arc<MutterState> for passing to sibling backends.
§Panics
Panics if called before CompositorRuntime::start has completed, or
after CompositorRuntime::stop. Callers are expected to follow the
fixed sequence: new() → start().await? → state().
Trait Implementations§
Source§impl CompositorRuntime for MutterCompositor
impl CompositorRuntime for MutterCompositor
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,
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,
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 wayland_display(&self) -> &str
fn wayland_display(&self) -> &str
Wayland display socket name (e.g.
wayland-wd-abc12345).Source§fn runtime_dir(&self) -> &Path
fn runtime_dir(&self) -> &Path
Per-session XDG_RUNTIME_DIR, holding the Wayland socket and any
supporting sockets like pipewire.
Source§impl Default for MutterCompositor
impl Default for MutterCompositor
Auto Trait Implementations§
impl Freeze for MutterCompositor
impl !RefUnwindSafe for MutterCompositor
impl Send for MutterCompositor
impl Sync for MutterCompositor
impl Unpin for MutterCompositor
impl UnsafeUnpin for MutterCompositor
impl !UnwindSafe for MutterCompositor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more