Struct dvcompute::simulation::queue::Queue [−][src]
pub struct Queue<SI, SM, SO, T> where
SI: QueueStrategy,
SM: QueueStrategy,
SO: QueueStrategy, { /* fields omitted */ }
Expand description
Represents an optimized bounded queue by using the specified strategies for enqueueing (input), SI
,
internal storing (in memory), SM
, and dequeueing (output), SO
, where T
denotes
the type of items stored in the queue.
Implementations
impl<SI, SM, SO, T> Queue<SI, SM, SO, T> where
SI: QueueStrategy + 'static,
SM: QueueStrategy + 'static,
SO: QueueStrategy + 'static,
T: Clone + 'static,
impl<SI, SM, SO, T> Queue<SI, SM, SO, T> where
SI: QueueStrategy + 'static,
SM: QueueStrategy + 'static,
SO: QueueStrategy + 'static,
T: Clone + 'static,
Create a new bounded queue by the specified strategies and capacity.
Test whether the queue is empty.
Test whether the queue is full.
Return the current queue size.
Return the load factor: the queue size divided by its capacity, i.e. maximum size.
Dequeue by suspending the process if the queue is empty.
Dequeue with output prioerity by suspending the process if the queue is empty.
Try to dequeue immediately.
Remove the item from the queue and return a flag indicating whether the item was found and actually removed.
Remove the specified item from the queue.
Remove an item satisfying the specified predicate and return the item if found.
Test whether there is an item satisfying the specified predicate.
Find an item satisfying the specified predicate.
Enqueue the item by suspending the process if the queue is full.
Enqueue the item with input priority by suspending the process if the queue is full.
Enqueue the item with storing priority by suspending the process if the queue is full.
Enqueue the item with input and storing priorities by suspending the process if the queue is full.
Try to enqueue the item. Return false
within Event
computation if the queue is full.