pub trait SystemPower {
// Required methods
fn get_system_power_state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = SystemPowerState> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn system_powerctl(&self, cmd: u32) -> Result<(), Status>;
fn has_resources(&self) -> bool;
fn exit(&self, status: i32);
}Expand description
System power operations.
Required Methods§
Sourcefn get_system_power_state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = SystemPowerState> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_system_power_state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = SystemPowerState> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the current system power state.
Sourcefn system_powerctl(&self, cmd: u32) -> Result<(), Status>
fn system_powerctl(&self, cmd: u32) -> Result<(), Status>
Executes a system power control command (e.g. reboot, shutdown).
Sourcefn has_resources(&self) -> bool
fn has_resources(&self) -> bool
Returns true if the necessary power resource is available.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".