PartialOrderStore

Trait PartialOrderStore 

Source
pub trait PartialOrderStore<K>
where K: Clone + Copy + StdHash + PartialEq + Eq,
{ // Required methods async fn mark_ready(&mut self, key: K) -> Result<bool, PartialOrderError>; async fn mark_pending( &mut self, key: K, dependencies: Vec<K>, ) -> Result<bool, PartialOrderError>; async fn get_next_pending( &self, key: K, ) -> Result<Option<HashSet<(K, Vec<K>)>>, PartialOrderError>; async fn take_next_ready(&mut self) -> Result<Option<K>, PartialOrderError>; async fn remove_pending( &mut self, key: K, ) -> Result<bool, PartialOrderError>; async fn ready(&self, keys: &[K]) -> Result<bool, PartialOrderError>; }
Expand description

Trait defining a store API for handling ready and pending dependencies.

An implementation of this store trait provides the following functionality:

  • maintain a list of all items which have all their dependencies met
  • maintain a list of items which don’t have their dependencies met
  • return all pending items which depend on a given item

Required Methods§

Source

async fn mark_ready(&mut self, key: K) -> Result<bool, PartialOrderError>

Add an item to the store which has all it’s dependencies met already. If this is the first time the item has been added it should also be pushed to the end of a “ready” queue.

Source

async fn mark_pending( &mut self, key: K, dependencies: Vec<K>, ) -> Result<bool, PartialOrderError>

Add an item which does not have all it’s dependencies met yet.

Source

async fn get_next_pending( &self, key: K, ) -> Result<Option<HashSet<(K, Vec<K>)>>, PartialOrderError>

Get all pending items which directly depend on the given key.

Source

async fn take_next_ready(&mut self) -> Result<Option<K>, PartialOrderError>

Take the next ready item from the ready queue.

Source

async fn remove_pending(&mut self, key: K) -> Result<bool, PartialOrderError>

Remove all items from the pending queue which depend on the passed key.

Source

async fn ready(&self, keys: &[K]) -> Result<bool, PartialOrderError>

Returns true of all the passed keys are present in the ready list.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§