pub struct AsyncQueue { /* private fields */ }Expand description
A simple async-style task queue that stores pending and completed tasks.
Implementations§
Source§impl AsyncQueue
impl AsyncQueue
pub fn new(max_concurrent: usize) -> Self
pub fn enqueue(&mut self, id: u64, label: &str) -> bool
pub fn pending_count(&self) -> usize
pub fn completed_count(&self) -> usize
pub fn total_count(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn running_count(&self) -> usize
pub fn can_start_more(&self) -> bool
pub fn start_next(&mut self) -> Option<u64>
pub fn complete_task(&mut self, id: u64) -> bool
pub fn fail_task(&mut self, id: u64) -> bool
pub fn set_progress(&mut self, id: u64, progress: f32) -> bool
pub fn clear_completed(&mut self)
pub fn get_task(&self, id: u64) -> Option<&AsyncTask>
pub fn failed_count(&self) -> usize
pub fn max_concurrent(&self) -> usize
Trait Implementations§
Source§impl Clone for AsyncQueue
impl Clone for AsyncQueue
Source§fn clone(&self) -> AsyncQueue
fn clone(&self) -> AsyncQueue
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 AsyncQueue
impl RefUnwindSafe for AsyncQueue
impl Send for AsyncQueue
impl Sync for AsyncQueue
impl Unpin for AsyncQueue
impl UnsafeUnpin for AsyncQueue
impl UnwindSafe for AsyncQueue
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