pub trait PartialOrderStore<K>{
// 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§
Sourceasync fn mark_ready(&mut self, key: K) -> Result<bool, PartialOrderError>
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.
Sourceasync fn mark_pending(
&mut self,
key: K,
dependencies: Vec<K>,
) -> Result<bool, PartialOrderError>
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.
Sourceasync fn get_next_pending(
&self,
key: K,
) -> Result<Option<HashSet<(K, Vec<K>)>>, PartialOrderError>
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.
Sourceasync fn take_next_ready(&mut self) -> Result<Option<K>, PartialOrderError>
async fn take_next_ready(&mut self) -> Result<Option<K>, PartialOrderError>
Take the next ready item from the ready queue.
Sourceasync fn remove_pending(&mut self, key: K) -> Result<bool, PartialOrderError>
async fn remove_pending(&mut self, key: K) -> Result<bool, PartialOrderError>
Remove all items from the pending queue which depend on the passed key.
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.