#[non_exhaustive]pub struct WakeLock;unstable only.Expand description
A guard that prevents the system from entering automatic light sleep.
While at least one WakeLock is held, WakeLock::is_active returns true
and the auto-lightsleep idle hook will not put the chip to sleep. The lock is
released when the guard is dropped.
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
Implementations§
Source§impl WakeLock
impl WakeLock
Sourcepub fn new() -> Self
pub fn new() -> Self
Acquires a wake lock, preventing automatic light sleep until it is dropped.
Sourcepub fn release()
pub fn release()
Releases a wake lock, allowing automatic light sleep when no wake locks are held.
Note that this function should only be called to release a wake lock acquired via
Self::acquire.
Trait Implementations§
Source§impl Clone for WakeLock
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
impl Clone for WakeLock
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
Source§impl Default for WakeLock
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
impl Default for WakeLock
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
Auto Trait Implementations§
impl Freeze for WakeLock
impl RefUnwindSafe for WakeLock
impl Send for WakeLock
impl Sync for WakeLock
impl Unpin for WakeLock
impl UnsafeUnpin for WakeLock
impl UnwindSafe for WakeLock
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)