pub struct KeepAwakeTask { /* private fields */ }Expand description
A keepalive running as a background task. Dropping it stops the task.
Implementations§
Source§impl KeepAwakeTask
impl KeepAwakeTask
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Whether the task is still polling.
Sourcepub fn request_stop(&self)
pub fn request_stop(&self)
Asks the task to stop. Idempotent; Self::finished waits for it.
Sourcepub async fn finished(&self) -> Result<KeepAwakeReport, Error>
pub async fn finished(&self) -> Result<KeepAwakeReport, Error>
Waits for the task to end and returns its report, or the error that ended it.
Callable any number of times, from any number of waiters.
Auto Trait Implementations§
impl !Freeze for KeepAwakeTask
impl RefUnwindSafe for KeepAwakeTask
impl Send for KeepAwakeTask
impl Sync for KeepAwakeTask
impl Unpin for KeepAwakeTask
impl UnsafeUnpin for KeepAwakeTask
impl UnwindSafe for KeepAwakeTask
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