Struct stack_graphs::stitching::Database [−][src]
pub struct Database { /* fields omitted */ }
Expand description
Contains a “database” of partial paths.
This type is meant to be a lazily loaded “view” into a proper storage layer. During the
path-stitching algorithm, we repeatedly try to extend a currently incomplete path with any
partial paths that are compatible with it. For large codebases, or projects with a large
number of dependencies, it can be prohibitive to load in all of the partial paths up-front.
We’ve written the path-stitching algorithm so that you have a chance to only load in the
partial paths that are actually needed, placing them into a Database
instance as they’re
needed.
Implementations
pub fn add_partial_path(
&mut self,
graph: &StackGraph,
partials: &mut PartialPaths,
path: PartialPath
) -> Handle<PartialPath>
pub fn add_partial_path(
&mut self,
graph: &StackGraph,
partials: &mut PartialPaths,
path: PartialPath
) -> Handle<PartialPath>
Adds a partial path to this database. We do not deduplicate partial paths in any way; it’s your responsibility to only add each partial path once.
pub fn find_candidate_partial_paths_from_root<R>(
&mut self,
graph: &StackGraph,
partials: &mut PartialPaths,
symbol_stack: SymbolStackKey,
result: &mut R
) where
R: Extend<Handle<PartialPath>>,
pub fn find_candidate_partial_paths_from_root<R>(
&mut self,
graph: &StackGraph,
partials: &mut PartialPaths,
symbol_stack: SymbolStackKey,
result: &mut R
) where
R: Extend<Handle<PartialPath>>,
Find all partial paths in this database that start at the root node, and have a symbol stack precondition that is compatible with a given symbol stack.
pub fn find_candidate_partial_paths_from_node<R>(
&self,
graph: &StackGraph,
partials: &mut PartialPaths,
start_node: Handle<Node>,
result: &mut R
) where
R: Extend<Handle<PartialPath>>,
pub fn find_candidate_partial_paths_from_node<R>(
&self,
graph: &StackGraph,
partials: &mut PartialPaths,
start_node: Handle<Node>,
result: &mut R
) where
R: Extend<Handle<PartialPath>>,
Find all partial paths in the database that start at the given node. We don’t filter the results any further than that, since we have to check each partial path for compatibility as we try to append it to the current incomplete path anyway, and non-root nodes will typically have a small number of outgoing edges.
Trait Implementations
type Output = PartialPath
type Output = PartialPath
The returned type after indexing.
Performs the indexing (container[index]
) operation. Read more