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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<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 moreCreates a shared type from an unshared type.