[][src]Struct desk_logind::Logind

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

A logind client connection. This is a relatively thin wrapper over the D-Bus API.

Implementations

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

pub fn new(conn: &'a Connection) -> Logind[src]

pub fn session(&self, id: &SessionId) -> Result<Session<'a>, LogindError>[src]

Get a handle to a logind session by ID.

pub fn current_session(&self) -> Result<Session<'a>, LogindError>[src]

Get a handle to the current logind session.

pub fn suspend(&self, interactive: bool) -> Result<(), LogindError>[src]

Attempt to suspend the system. If interactive, PolicyKit may prompt the current user for authentication if needed.

pub fn reboot(&self, interactive: bool) -> Result<(), LogindError>[src]

Attempt to reboot the system. If interactive, PolicyKit may prompt the current user for authentication.

pub fn power_off(&self, interactive: bool) -> Result<(), LogindError>[src]

Attempt to power off the system. If interactive, PolicyKit may prompt the current user for authentication.

pub fn hibernate(&self, interactive: bool) -> Result<(), LogindError>[src]

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>
[src]

pub fn on_sleep<F: Fn(Logind) + Send + 'static, G: Fn(Logind) + Send + 'static>(
    &self,
    pre_sleep: F,
    post_sleep: G
) -> Result<(), LogindError>
[src]

Auto Trait Implementations

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

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

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

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

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.