pub struct Unstoppable;Expand description
A Stop implementation that never stops (no cooperative cancellation).
This is a zero-cost type for callers who don’t need cancellation support. All methods are inlined and optimized away.
The name Unstoppable clearly communicates that this operation cannot be
cooperatively cancelled - there is no cancellation token to check.
§Example
use enough::{Stop, Unstoppable};
fn process(data: &[u8], stop: impl Stop) -> Vec<u8> {
// ...
}
// Caller doesn't need cancellation
let data = [1u8, 2, 3];
let result = process(&data, Unstoppable);Trait Implementations§
Source§impl Clone for Unstoppable
impl Clone for Unstoppable
Source§fn clone(&self) -> Unstoppable
fn clone(&self) -> Unstoppable
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Unstoppable
impl Debug for Unstoppable
Source§impl Default for Unstoppable
impl Default for Unstoppable
Source§fn default() -> Unstoppable
fn default() -> Unstoppable
Returns the “default value” for a type. Read more
Source§impl Hash for Unstoppable
impl Hash for Unstoppable
Source§impl PartialEq for Unstoppable
impl PartialEq for Unstoppable
Source§impl Stop for Unstoppable
impl Stop for Unstoppable
impl Copy for Unstoppable
impl Eq for Unstoppable
impl StructuralPartialEq for Unstoppable
Auto Trait Implementations§
impl Freeze for Unstoppable
impl RefUnwindSafe for Unstoppable
impl Send for Unstoppable
impl Sync for Unstoppable
impl Unpin for Unstoppable
impl UnwindSafe for Unstoppable
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> StopExt for Twhere
T: Stop,
impl<T> StopExt for Twhere
T: Stop,
Source§impl<T> TimeoutExt for Twhere
T: Stop,
impl<T> TimeoutExt for Twhere
T: Stop,
Source§fn with_timeout(self, duration: Duration) -> WithTimeout<Self>
fn with_timeout(self, duration: Duration) -> WithTimeout<Self>
Add a timeout to this stop. Read more
Source§fn with_deadline(self, deadline: Instant) -> WithTimeout<Self>
fn with_deadline(self, deadline: Instant) -> WithTimeout<Self>
Add an absolute deadline to this stop. Read more