Skip to main content

Desk

Trait Desk 

Source
pub(super) trait Desk {
    // Required methods
    fn kind(&mut self) -> Kind;
    fn inhibit(&mut self, reason: &str) -> Result<Box<dyn Held>, String>;
    fn plasma_shows_doses(&self) -> bool;
    fn banners(&self) -> Result<bool, String>;
    fn set_banners(&self, shown: bool) -> Result<(), String>;
    fn watch_banners(&self) -> Option<Box<dyn Heard>>;
    fn sandboxed(&self) -> bool;
    fn inhibited(&self) -> Option<bool>;
    fn plasma_until(&self) -> Option<i64>;
    fn clear_plasma_until(&self) -> Result<(), String>;
    fn follow(
        &self,
        kind: &Kind,
        quiet: Arc<Mutex<Instant>>,
        told: Arc<dyn Fn(bool) + Send + Sync>,
    ) -> Option<Box<dyn Watching>>;
}
Expand description

The session’s side, behind a trait: tested with a stand-in.

Required Methods§

Source

fn kind(&mut self) -> Kind

Source

fn inhibit(&mut self, reason: &str) -> Result<Box<dyn Held>, String>

Plasma’s inhibition for reason, held until released or dropped.

Source

fn plasma_shows_doses(&self) -> bool

Whether Plasma shows Sioul’s notifications during its do-not-disturb.

Source

fn banners(&self) -> Result<bool, String>

GNOME’s banners shown (its Do Not Disturb off).

Source

fn set_banners(&self, shown: bool) -> Result<(), String>

Source

fn watch_banners(&self) -> Option<Box<dyn Heard>>

dconf’s changes of GNOME’s switch, heard from now on.

Source

fn sandboxed(&self) -> bool

Sioul runs in a Flatpak: GNOME’s settings out of reach.

Source

fn inhibited(&self) -> Option<bool>

The notification server’s Inhibited now: Plasma’s do-not-disturb, whatever its cause.

Source

fn plasma_until(&self) -> Option<i64>

The end of Plasma’s own do-not-disturb ([DoNotDisturb] Until, Unix seconds), when ahead.

Source

fn clear_plasma_until(&self) -> Result<(), String>

Plasma’s own do-not-disturb ended: Until deleted, Plasma told.

Source

fn follow( &self, kind: &Kind, quiet: Arc<Mutex<Instant>>, told: Arc<dyn Fn(bool) + Send + Sync>, ) -> Option<Box<dyn Watching>>

Follows the session’s own do-not-disturb (Plasma’s Inhibited, GNOME’s switch), telling each change once Sioul’s own settled (quiet).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Desk for Session

Available on Unix and neither Android nor macOS only.