pub struct QueueManager { /* private fields */ }Expand description
Queue manager
Implementations§
Source§impl QueueManager
impl QueueManager
pub fn new() -> Self
Sourcepub fn enqueue(&mut self, operation: QueuedOperation)
pub fn enqueue(&mut self, operation: QueuedOperation)
Enqueue a pending operation.
Sourcepub fn dequeue(&mut self) -> Option<QueuedOperation>
pub fn dequeue(&mut self) -> Option<QueuedOperation>
Dequeue the next pending operation (FIFO order). Returns None when
the queue is empty.
Sourcepub fn pending_queue(&self) -> &[QueuedOperation]
pub fn pending_queue(&self) -> &[QueuedOperation]
Returns the pending operations currently in the queue.
Sourcepub fn pending_count(&self) -> usize
pub fn pending_count(&self) -> usize
Returns the number of pending operations.
Sourcepub fn start_operation(&mut self, operation: RunningOperation)
pub fn start_operation(&mut self, operation: RunningOperation)
Mark an operation as running, recording it under operation_id.
Sourcepub fn get_running_operation(
&self,
operation_id: &str,
) -> Option<&RunningOperation>
pub fn get_running_operation( &self, operation_id: &str, ) -> Option<&RunningOperation>
Look up a running operation by id.
Sourcepub fn remove_running_operation(
&mut self,
operation_id: &str,
) -> Option<RunningOperation>
pub fn remove_running_operation( &mut self, operation_id: &str, ) -> Option<RunningOperation>
Remove a running operation (e.g. when it finishes), returning it so the caller can record completion.
Sourcepub fn running_count(&self) -> usize
pub fn running_count(&self) -> usize
Returns the number of currently running operations.
Sourcepub fn record_completed(&mut self, operation: CompletedOperation)
pub fn record_completed(&mut self, operation: CompletedOperation)
Record a completed operation.
Sourcepub fn completed_operations(&self) -> &[CompletedOperation]
pub fn completed_operations(&self) -> &[CompletedOperation]
Returns the completed operations.
Sourcepub fn completed_count(&self) -> usize
pub fn completed_count(&self) -> usize
Returns the number of completed operations.
Auto Trait Implementations§
impl Freeze for QueueManager
impl RefUnwindSafe for QueueManager
impl Send for QueueManager
impl Sync for QueueManager
impl Unpin for QueueManager
impl UnsafeUnpin for QueueManager
impl UnwindSafe for QueueManager
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more