pub struct PartialOrderer<T> { /* private fields */ }Expand description
Queue which checks if dependencies are met for an item and returning it as “ready”.
Internally this assumes a structure where items can point at others as “dependencies”, forming an DAG (Directed Acyclic Graph). The “orderer” monitors incoming items, asserts if the dependencies are met and yields a linearized sequence of “dependency checked” items.
Implementations§
Source§impl<T> PartialOrderer<T>
impl<T> PartialOrderer<T>
pub fn mark_ready( y: PartialOrdererState<T>, key: T, ) -> Result<(PartialOrdererState<T>, bool), PartialOrdererError>
pub fn mark_pending( y: PartialOrdererState<T>, key: T, dependencies: Vec<T>, ) -> Result<(PartialOrdererState<T>, bool), PartialOrdererError>
pub fn get_next_pending( y: &PartialOrdererState<T>, key: T, ) -> Result<Option<HashSet<(T, Vec<T>)>>, PartialOrdererError>
pub fn take_next_ready( y: PartialOrdererState<T>, ) -> Result<(PartialOrdererState<T>, Option<T>), PartialOrdererError>
pub fn remove_pending( y: PartialOrdererState<T>, key: T, ) -> Result<(PartialOrdererState<T>, bool), PartialOrdererError>
pub fn ready( y: &PartialOrdererState<T>, dependencies: &[T], ) -> Result<bool, PartialOrdererError>
pub fn process_pending( y: PartialOrdererState<T>, key: T, ) -> Result<PartialOrdererState<T>, PartialOrdererError>
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for PartialOrderer<T>
impl<T> RefUnwindSafe for PartialOrderer<T>where
T: RefUnwindSafe,
impl<T> Send for PartialOrderer<T>where
T: Send,
impl<T> Sync for PartialOrderer<T>where
T: Sync,
impl<T> Unpin for PartialOrderer<T>where
T: Unpin,
impl<T> UnwindSafe for PartialOrderer<T>where
T: UnwindSafe,
Blanket Implementations§
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