pub trait SleepControl {
// Required methods
unsafe fn reset(&mut self);
fn inhibit_standby(&mut self) -> PermitStandbyToken;
fn permit_standby(&mut self, token: PermitStandbyToken);
fn standby_permitted(&self) -> bool;
fn inhibit_idle(&mut self) -> PermitIdleToken;
fn permit_idle(&mut self, token: PermitIdleToken);
fn idle_permitted(&self) -> bool;
}
Required Methods§
sourceunsafe fn reset(&mut self)
unsafe fn reset(&mut self)
Reset the sleep mode to default state. Both Idle and Standby mode will be uninhibited.
sourcefn inhibit_standby(&mut self) -> PermitStandbyToken
fn inhibit_standby(&mut self) -> PermitStandbyToken
Prevent the CPU going into Standby mode. The CPU will not be allowed
to Standby until a corresponding call to permit_standby()
is made.
Calls may be nested, but up to a hard limit of 256.
§Panics
Will panic if more than 256 inhibit_sleep() calls are made without corresponding permit_standby().
sourcefn permit_standby(&mut self, token: PermitStandbyToken)
fn permit_standby(&mut self, token: PermitStandbyToken)
Permit the CPU to enter Standby mode, if it was previously inhibited
by inhibit_standby()
.
If stanndby was already permitted, this call does nothing.
sourcefn standby_permitted(&self) -> bool
fn standby_permitted(&self) -> bool
Return true iff the CPU is currently permitted to Standby.
sourcefn inhibit_idle(&mut self) -> PermitIdleToken
fn inhibit_idle(&mut self) -> PermitIdleToken
Prevent the CPU going into Idle mode. The CPU will not be allowed
to Idle until a corresponding call to permit_idle()
is made.
Calls may be nested, but up to a hard limit of 256.
§Panics
Will panic if more than 256 inhibit_idle() calls are made without corresponding permit_idle().
sourcefn permit_idle(&mut self, token: PermitIdleToken)
fn permit_idle(&mut self, token: PermitIdleToken)
Permit the CPU to enter Idle mode, if it was previously inhibited
by inhibit_idle()
.
If sleep was already permitted, this call does nothing.
sourcefn idle_permitted(&self) -> bool
fn idle_permitted(&self) -> bool
Return true iff the CPU is currently permitted to Idle.