pub struct FlattenedDependencies<'a> { /* private fields */ }Expand description
A wrapper around the directed, acyclic graph of system edges.
This allows tracking mutations to the graph for recording build pass changes.
Implementations§
Source§impl FlattenedDependencies<'_>
impl FlattenedDependencies<'_>
Sourcepub fn add_edge(&mut self, system_1: SystemKey, system_2: SystemKey)
pub fn add_edge(&mut self, system_1: SystemKey, system_2: SystemKey)
Adds an edge to the dependencies such that system_1 runs before system_2.
Sourcepub fn remove_edge(&mut self, system_1: SystemKey, system_2: SystemKey)
pub fn remove_edge(&mut self, system_1: SystemKey, system_2: SystemKey)
Removes an edge going from system_1 to system_2 in the dependencies.
This should be used with caution - removing edges this way can lead to very surprising behavior. However, this function can be used to remove dependencies that are made redundant by added edges.
Note: these edges are not reported like the added edges are.
Sourcepub fn toposort(
&mut self,
) -> Result<&[SystemKey], DiGraphToposortError<SystemKey>>
pub fn toposort( &mut self, ) -> Result<&[SystemKey], DiGraphToposortError<SystemKey>>
Returns a topological ordering of the graph, computing it if the graph is dirty.
This function matches Dag::toposort.
Sourcepub fn toposort_and_graph(
&mut self,
) -> Result<(&[SystemKey], &DiGraph<SystemKey>), DiGraphToposortError<SystemKey>>
pub fn toposort_and_graph( &mut self, ) -> Result<(&[SystemKey], &DiGraph<SystemKey>), DiGraphToposortError<SystemKey>>
Returns both the topological ordering and the underlying graph, computing the toposort if the graph is dirty.
This function matches Dag::toposort_and_graph.
Sourcepub fn analyze(
&mut self,
) -> Result<DagAnalysis<SystemKey>, DiGraphToposortError<SystemKey>>
pub fn analyze( &mut self, ) -> Result<DagAnalysis<SystemKey>, DiGraphToposortError<SystemKey>>
Processes the DAG and computes various properties about it.
This function matches Dag::analyze.
Methods from Deref<Target = Dag<SystemKey>>§
Sourcepub fn is_dirty(&self) -> bool
pub fn is_dirty(&self) -> bool
Returns whether the graph is dirty (i.e., has been modified since the last topological sort).
Sourcepub fn is_toposorted(&self) -> bool
pub fn is_toposorted(&self) -> bool
Returns whether the graph is topologically sorted (i.e., not dirty).
Sourcepub fn get_toposort(&self) -> Option<&[N]>
pub fn get_toposort(&self) -> Option<&[N]>
Returns the cached toposort if the graph is not dirty, otherwise returns
None.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for FlattenedDependencies<'a>
impl<'a> RefUnwindSafe for FlattenedDependencies<'a>
impl<'a> Send for FlattenedDependencies<'a>
impl<'a> Sync for FlattenedDependencies<'a>
impl<'a> Unpin for FlattenedDependencies<'a>
impl<'a> UnsafeUnpin for FlattenedDependencies<'a>
impl<'a> !UnwindSafe for FlattenedDependencies<'a>
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.