pub struct Logind<'a> { /* private fields */ }Expand description
A logind client connection. This is a relatively thin wrapper over the D-Bus API.
Implementations§
Source§impl<'a> Logind<'a>
impl<'a> Logind<'a>
pub fn new(conn: &'a Connection) -> Logind<'_>
Sourcepub fn session(&self, id: &SessionId) -> Result<Session<'a>, LogindError>
pub fn session(&self, id: &SessionId) -> Result<Session<'a>, LogindError>
Get a handle to a logind session by ID.
Sourcepub fn current_session(&self) -> Result<Session<'a>, LogindError>
pub fn current_session(&self) -> Result<Session<'a>, LogindError>
Get a handle to the current logind session.
Sourcepub fn suspend(&self, interactive: bool) -> Result<(), LogindError>
pub fn suspend(&self, interactive: bool) -> Result<(), LogindError>
Attempt to suspend the system. If interactive, PolicyKit may prompt the current user
for authentication if needed.
Sourcepub fn reboot(&self, interactive: bool) -> Result<(), LogindError>
pub fn reboot(&self, interactive: bool) -> Result<(), LogindError>
Attempt to reboot the system. If interactive, PolicyKit may prompt the current user for
authentication.
Sourcepub fn power_off(&self, interactive: bool) -> Result<(), LogindError>
pub fn power_off(&self, interactive: bool) -> Result<(), LogindError>
Attempt to power off the system. If interactive, PolicyKit may prompt the current user for
authentication.
Sourcepub fn hibernate(&self, interactive: bool) -> Result<(), LogindError>
pub fn hibernate(&self, interactive: bool) -> Result<(), LogindError>
Attempt to hibernate the system. If interactive, PolicyKit may prompt the current user for
authentication.
pub fn inhibit( &self, who: &str, why: &str, events: &InhibitEventSet, mode: InhibitMode, ) -> Result<InhibitorLock, LogindError>
pub fn on_sleep<F: Fn(Logind<'_>) + Send + 'static, G: Fn(Logind<'_>) + Send + 'static>( &self, pre_sleep: F, post_sleep: G, ) -> Result<(), LogindError>
Auto Trait Implementations§
impl<'a> Freeze for Logind<'a>
impl<'a> !RefUnwindSafe for Logind<'a>
impl<'a> !Send for Logind<'a>
impl<'a> !Sync for Logind<'a>
impl<'a> Unpin for Logind<'a>
impl<'a> !UnwindSafe for Logind<'a>
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