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 with_gsettings(self, config: GSettingsConfig) -> Self
pub fn with_gsettings(self, config: GSettingsConfig) -> Self
Set the per-session GSettings isolation config (see
waydriver::gsettings). Defaults to isolated with no seeded entries.
When isolated, start writes a private keyfile (seeded
with org.gnome.mutter experimental-features plus config.initial)
and points mutter at it, so fractional scales work and the host’s dconf
is neither read nor written. Pass isolated: false to run mutter
against the host’s GSettings instead.
Sourcepub fn state(&self) -> Option<Arc<MutterState>>
pub fn state(&self) -> Option<Arc<MutterState>>
Returns the shared Arc<MutterState> for passing to sibling
backends, or None when called outside the started window.
None is returned when:
start()has not yet completed (or returned an error), orstop()has been called and dropped the state.
Callers that have just awaited start()? know the state is
present — expect() or ?-with-typed-error is appropriate
there. Returning Option instead of panicking keeps the API
honest about the lifecycle and lets callers detect “stopped”
without first matching on a panic.
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>,
scale: Option<f64>,
) -> 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>,
scale: Option<f64>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
None) and wait for it to be ready. After this
returns successfully, wayland_display() and runtime_dir() must
point at a live Wayland socket. Read moreSource§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,
Source§fn wayland_display(&self) -> &str
fn wayland_display(&self) -> &str
wayland-wd-abc12345).Source§fn runtime_dir(&self) -> &Path
fn runtime_dir(&self) -> &Path
Source§impl Default for MutterCompositor
impl Default for MutterCompositor
Source§impl Drop for MutterCompositor
impl Drop for MutterCompositor
Auto Trait Implementations§
impl !RefUnwindSafe for MutterCompositor
impl !UnwindSafe for MutterCompositor
impl Freeze for MutterCompositor
impl Send for MutterCompositor
impl Sync for MutterCompositor
impl Unpin for MutterCompositor
impl UnsafeUnpin 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
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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().