pub struct Immortal(/* private fields */);
Expand description
Immortal represents a task that can never stop, unless it is explicity cancelled or dropped from the outside. We can think of this as a Task<!>, except with some nice convenience methods.
Implementations§
source§impl Immortal
impl Immortal
sourcepub fn spawn<F: Future<Output = Infallible> + Send + 'static>(f: F) -> Self
pub fn spawn<F: Future<Output = Infallible> + Send + 'static>(f: F) -> Self
Directly spawns an immortal future.
Auto Trait Implementations§
impl RefUnwindSafe for Immortal
impl Send for Immortal
impl Sync for Immortal
impl Unpin for Immortal
impl UnwindSafe for Immortal
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