pub struct PowerAssertion { /* private fields */ }Expand description
A native, reference-counted request that prevents one class of automatic sleep.
The assertion is released when this value is dropped or when Self::release is called.
Keep the value alive for exactly as long as the work requiring the assertion. Assertions are
process resources and do not schedule a timer or polling task.
Implementations§
Source§impl PowerAssertion
impl PowerAssertion
Sourcepub fn acquire(
kind: PowerAssertionKind,
reason: impl Into<Arc<str>>,
) -> Result<Self>
pub fn acquire( kind: PowerAssertionKind, reason: impl Into<Arc<str>>, ) -> Result<Self>
Acquire a native assertion with a bounded, human-readable diagnostic reason.
pub const fn kind(&self) -> PowerAssertionKind
pub fn reason(&self) -> &str
pub const fn is_active(&self) -> bool
Trait Implementations§
Source§impl Debug for PowerAssertion
impl Debug for PowerAssertion
Source§impl Drop for PowerAssertion
impl Drop for PowerAssertion
Auto Trait Implementations§
impl Forget for PowerAssertion
impl Freeze for PowerAssertion
impl Move for PowerAssertion
impl RefUnwindSafe for PowerAssertion
impl Send for PowerAssertion
impl Sync for PowerAssertion
impl Unpin for PowerAssertion
impl UnsafeUnpin for PowerAssertion
impl UnwindSafe for PowerAssertion
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