[][src]Struct logind_dbus::LoginManagerConnection

pub struct LoginManagerConnection<'a> { /* fields omitted */ }

An established connection path for the login manager, through which the API is made accessible.

Methods

impl<'a> LoginManagerConnection<'a>[src]

pub fn inhibit(
    &self,
    what: &str,
    who: &str,
    why: &str,
    mode: &str
) -> Result<OwnedFd, Error>
[src]

Inhibit is the only API necessary to take a lock. It takes four arguments:

  • What is a colon-separated list of lock types, i.e. shutdown, sleep, idle, handle-power-key, handle-suspend-key, handle-hibernate-key, handle-lid-switch. Example: "shutdown:idle"
  • Who is a human-readable, descriptive string of who is taking the lock. Example: "Package Updater"
  • Why is a human-readable, descriptive string of why the lock is taken. Example: "Package Update in Progress"
  • Mode is one of block or delay.

Notes

A root user session cannot use systemd inhibitors.

pub fn inhibit_suspend(&self, who: &str, why: &str) -> Result<OwnedFd, Error>[src]

Convenience method for inhibiting suspend.

Equivalent to connection.inhibit("idle:shutdown:sleep", who, why, "block").

Auto Trait Implementations

impl<'a> !Send for LoginManagerConnection<'a>

impl<'a> !Sync for LoginManagerConnection<'a>

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.