Trait dvcompute::simulation::strategy::BoxableQueueStorage[][src]

pub trait BoxableQueueStorage {
    type Priority;
    type Item;
    fn is_empty(&self, p: &Point<'_>) -> bool;
fn pop(&self, p: &Point<'_>) -> Option<Self::Item>;
fn push(&self, item: Self::Item, p: &Point<'_>);
fn push_with_priority(
        &self,
        priority: Self::Priority,
        item: Self::Item,
        p: &Point<'_>
    );
fn remove_boxed_by(
        &self,
        predicate: Box<dyn Fn(&Self::Item) -> bool>,
        p: &Point<'_>
    ) -> Option<Self::Item>;
fn exists_boxed(
        &self,
        predicate: Box<dyn Fn(&Self::Item) -> bool>,
        p: &Point<'_>
    ) -> bool;
fn find_boxed(
        &self,
        predicate: Box<dyn Fn(&Self::Item) -> bool>,
        p: &Point<'_>
    ) -> Option<Self::Item>
    where
        Self::Item: Clone
; }
Expand description

Represents a QueueStorage that can be boxed.

Associated Types

The type of priorities, if push_with_priority is supported. Otherwise, it may define the () type.

The type of items.

Required methods

Test whether the storage is empty.

Pop the front item.

Push an item, or panic if only push_with_priority is supported.

Push an item with the specified priority, or panic if only push is supported.

Try to remove an item satisfying the specified predicate and return the item removed.

Detect whether there is an element satisfying the specified predicate in the queue.

Find an element satisfying the specified predicate.

Implementors