pub struct SuspendResumeManager { /* private fields */ }Expand description
Manager for suspend and resume.
Implementations§
Source§impl SuspendResumeManager
impl SuspendResumeManager
pub fn add_external_wake_source( &self, handle: NullableHandle, signals: Signals, name: String, ) -> Result<(), Errno>
pub fn remove_external_wake_source( &self, handle: NullableHandle, ) -> Result<(), Errno>
Source§impl SuspendResumeManager
impl SuspendResumeManager
Sourcepub fn lock(&self) -> MutexGuard<'_, SuspendResumeManagerInner>
pub fn lock(&self) -> MutexGuard<'_, SuspendResumeManagerInner>
Locks and returns the inner state of the manager.
Sourcepub fn init(
self: &SuspendResumeManagerHandle,
system_task: &CurrentTask,
) -> Result<(), Error>
pub fn init( self: &SuspendResumeManagerHandle, system_task: &CurrentTask, ) -> Result<(), Error>
Power on the PowerMode element and start listening to the suspend stats updates.
pub fn activate_wakeup_source(&self, origin: WakeupSourceOrigin) -> bool
pub fn deactivate_wakeup_source(&self, origin: &WakeupSourceOrigin) -> bool
pub fn timeout_wakeup_source(&self, origin: &WakeupSourceOrigin) -> bool
pub fn add_message_counter( &self, name: &str, counter: Option<Counter>, ) -> OwnedMessageCounterHandle
pub fn has_nonzero_message_counter(&self) -> bool
Sourcepub fn duplicate_lock_event(&self) -> EventPair
pub fn duplicate_lock_event(&self) -> EventPair
Returns a duplicate handle to the EventPair that is signaled when wake
locks are active.
Sourcepub fn suspend_stats(&self) -> SuspendStats
pub fn suspend_stats(&self) -> SuspendStats
Gets the suspend statistics.
pub fn total_wakeup_events(&self) -> u64
Sourcepub fn sync_on_suspend_enabled(&self) -> bool
pub fn sync_on_suspend_enabled(&self) -> bool
Get the contents of the power “sync_on_suspend” file in the power
filesystem. True will cause 1 to be reported, and false will cause
0 to be reported.
Sourcepub fn set_sync_on_suspend(&self, enable: bool)
pub fn set_sync_on_suspend(&self, enable: bool)
Get the contents of the power “sync_on_suspend” file in the power filesystem. See also [sync_on_suspend_enabled].
Sourcepub fn suspend_states(&self) -> HashSet<SuspendState>
pub fn suspend_states(&self) -> HashSet<SuspendState>
Returns the supported suspend states.
pub fn suspend( &self, locked: &mut Locked<FileOpsCore>, suspend_state: SuspendState, ) -> Result<(), Errno>
pub fn acquire_ebpf_suspend_lock<'a, L>(
&'a self,
locked: &'a mut Locked<L>,
) -> EbpfSuspendGuard<'a>where
L: LockBefore<EbpfSuspendLock>,
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SuspendResumeManager
impl !RefUnwindSafe for SuspendResumeManager
impl Send for SuspendResumeManager
impl Sync for SuspendResumeManager
impl Unpin for SuspendResumeManager
impl !UnwindSafe for SuspendResumeManager
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
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
Converts the given service transport handle of type
T to [Self]Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T, U> MultiArchFrom<T> for Uwhere
U: From<T>,
impl<T, U> MultiArchFrom<T> for Uwhere
U: From<T>,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
type Error = <U as TryFromExt<T>>::Error
§fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
Tries to perform the conversion.