pub struct TaskFuture { /* private fields */ }Expand description
A future that tracks completion of submitted tasks
TaskFuture provides both blocking and non-blocking ways to wait for
task completion, with efficient condition variable notification.
Tasks can be checked for completion, waited on indefinitely, or
waited on with a timeout.
Implementations§
Source§impl TaskFuture
impl TaskFuture
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Check if all tasks are complete without blocking
Returns true if all tasks have finished execution.
This is a non-blocking operation using atomic loads.
Sourcepub fn wait(self)
pub fn wait(self)
Wait for all tasks to complete
This method blocks the current thread until all tasks finish. It uses efficient condition variable notification to minimize CPU usage while waiting.
Sourcepub fn wait_timeout(self, timeout: Duration) -> bool
pub fn wait_timeout(self, timeout: Duration) -> bool
Wait for all tasks to complete with a timeout
Returns true if all tasks completed within the timeout,
false if the timeout was reached first.
Trait Implementations§
Source§impl Clone for TaskFuture
impl Clone for TaskFuture
Source§fn clone(&self) -> TaskFuture
fn clone(&self) -> TaskFuture
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 moreAuto Trait Implementations§
impl Freeze for TaskFuture
impl RefUnwindSafe for TaskFuture
impl Send for TaskFuture
impl Sync for TaskFuture
impl Unpin for TaskFuture
impl UnwindSafe for TaskFuture
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