pub struct ActiveTasks { /* private fields */ }Expand description
Tracks active model tasks per thread.
Implementations§
Source§impl ActiveTasks
impl ActiveTasks
pub fn new() -> Self
Sourcepub fn register(&mut self, thread_id: ThreadId, handle: JoinHandle<()>)
pub fn register(&mut self, thread_id: ThreadId, handle: JoinHandle<()>)
Register a new task for a thread. If there’s already a task for this thread, it will be aborted.
Sourcepub fn is_running(&self, thread_id: &ThreadId) -> bool
pub fn is_running(&self, thread_id: &ThreadId) -> bool
Check if a thread has an active task.
Sourcepub fn running_threads(&self) -> Vec<ThreadId>
pub fn running_threads(&self) -> Vec<ThreadId>
Get IDs of all threads with active tasks.
Trait Implementations§
Source§impl Debug for ActiveTasks
impl Debug for ActiveTasks
Source§impl Default for ActiveTasks
impl Default for ActiveTasks
Source§fn default() -> ActiveTasks
fn default() -> ActiveTasks
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ActiveTasks
impl RefUnwindSafe for ActiveTasks
impl Send for ActiveTasks
impl Sync for ActiveTasks
impl Unpin for ActiveTasks
impl UnsafeUnpin for ActiveTasks
impl UnwindSafe for ActiveTasks
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