Struct logind_dbus::LoginManagerConnection
source · pub struct LoginManagerConnection<'a> { /* private fields */ }
Expand description
An established connection path for the login manager, through which the API is made accessible.
Implementations
sourceimpl<'a> LoginManagerConnection<'a>
impl<'a> LoginManagerConnection<'a>
sourcepub fn inhibit(
&self,
what: &str,
who: &str,
why: &str,
mode: &str
) -> Result<OwnedFd, Error>
pub fn inhibit(
&self,
what: &str,
who: &str,
why: &str,
mode: &str
) -> Result<OwnedFd, Error>
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
ordelay
.
Notes
A root user session cannot use systemd inhibitors.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for LoginManagerConnection<'a>
impl<'a> !Send for LoginManagerConnection<'a>
impl<'a> !Sync for LoginManagerConnection<'a>
impl<'a> Unpin for LoginManagerConnection<'a>
impl<'a> !UnwindSafe for LoginManagerConnection<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more