pub struct PrecedenceGraph<I> { /* private fields */ }Expand description
A validated finite precedence DAG over stable event ids.
Implementations§
Source§impl PrecedenceGraph<SerialEventId>
impl PrecedenceGraph<SerialEventId>
Sourcepub fn try_new(
edges: impl IntoIterator<Item = (SerialEventId, SerialEventId)>,
known_nodes: &BTreeSet<SerialEventId>,
) -> Result<Self, SerialPlanError>
pub fn try_new( edges: impl IntoIterator<Item = (SerialEventId, SerialEventId)>, known_nodes: &BTreeSet<SerialEventId>, ) -> Result<Self, SerialPlanError>
Builds a graph from before -> after edges.
Sourcepub fn contains_edge(
&self,
before: &SerialEventId,
after: &SerialEventId,
) -> bool
pub fn contains_edge( &self, before: &SerialEventId, after: &SerialEventId, ) -> bool
Returns whether one direct precedence edge exists.
Sourcepub fn successors(
&self,
event_id: &SerialEventId,
) -> Option<&BTreeSet<SerialEventId>>
pub fn successors( &self, event_id: &SerialEventId, ) -> Option<&BTreeSet<SerialEventId>>
Returns the outgoing precedence targets for one event.
Sourcepub fn edges(&self) -> impl Iterator<Item = (&SerialEventId, &SerialEventId)>
pub fn edges(&self) -> impl Iterator<Item = (&SerialEventId, &SerialEventId)>
Returns every direct precedence edge in canonical order.
Trait Implementations§
Source§impl<I: Clone> Clone for PrecedenceGraph<I>
impl<I: Clone> Clone for PrecedenceGraph<I>
Source§fn clone(&self) -> PrecedenceGraph<I>
fn clone(&self) -> PrecedenceGraph<I>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<I: Debug> Debug for PrecedenceGraph<I>
impl<I: Debug> Debug for PrecedenceGraph<I>
Source§impl<I: Ord> Default for PrecedenceGraph<I>
impl<I: Ord> Default for PrecedenceGraph<I>
impl<I: Eq> Eq for PrecedenceGraph<I>
Source§impl<I: PartialEq> PartialEq for PrecedenceGraph<I>
impl<I: PartialEq> PartialEq for PrecedenceGraph<I>
impl<I: PartialEq> StructuralPartialEq for PrecedenceGraph<I>
Auto Trait Implementations§
impl<I> Freeze for PrecedenceGraph<I>
impl<I> RefUnwindSafe for PrecedenceGraph<I>where
I: RefUnwindSafe,
impl<I> Send for PrecedenceGraph<I>where
I: Send,
impl<I> Sync for PrecedenceGraph<I>where
I: Sync,
impl<I> Unpin for PrecedenceGraph<I>
impl<I> UnsafeUnpin for PrecedenceGraph<I>
impl<I> UnwindSafe for PrecedenceGraph<I>where
I: RefUnwindSafe,
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