pub struct SuspendResumeManager { /* private fields */ }Expand description
Manager for suspend and resume.
Implementations§
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.
Sourcepub fn add_lock(&self, name: &str, src: LockSource) -> bool
pub fn add_lock(&self, name: &str, src: LockSource) -> bool
Adds a wake lock name to the active wake locks.
Sourcepub fn remove_lock(&self, name: &str) -> bool
pub fn remove_lock(&self, name: &str) -> bool
Removes a wake lock name from the active wake locks.
Sourcepub fn add_epoll(&self, current_task: &CurrentTask, key: EpollKey)
pub fn add_epoll(&self, current_task: &CurrentTask, key: EpollKey)
Adds a wake lock key to the active epoll wake locks.
Sourcepub fn remove_epoll(&self, key: EpollKey)
pub fn remove_epoll(&self, key: EpollKey)
Removes a wake lock key from the active epoll wake locks.
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.
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>, 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
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
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>
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>
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 more