pub struct Database { /* private fields */ }
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§

Creates a new, empty database.

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.

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.

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.

Determines which nodes in the stack graph are “local”, taking into account the partial paths in this database.

A local node has no partial path that connects it to the root node in either direction. That means that it cannot participate in any paths that leave the file.

This method is meant to be used at index time, to calculate the set of nodes that are local after having just calculated the set of partial paths for the file.

Marks that a stack graph node is local.

This method is meant to be used at query time. You will have precalculated the set of local nodes for a file at index time; at query time, you will load this information from your storage layer and use this method to update our internal view of which nodes are local.

Returns whether a node is local according to the partial paths in this database. You must have already called [find_local_nodes][] or [mark_local_node][], depending on whether it is index time or query time.

Returns an iterator over all of the handles of all of the partial paths in this database. (Note that because we’re only returning handles, this iterator does not retain a reference to the Database.)

Trait Implementations§

The returned type after indexing.
Performs the indexing (container[index]) operation. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Converts self into T using Into<T>. Read more
Causes self to use its Binary implementation when Debug-formatted.
Causes self to use its Display implementation when Debug-formatted.
Causes self to use its LowerExp implementation when Debug-formatted.
Causes self to use its LowerHex implementation when Debug-formatted.
Causes self to use its Octal implementation when Debug-formatted.
Causes self to use its Pointer implementation when Debug-formatted.
Causes self to use its UpperExp implementation when Debug-formatted.
Causes self to use its UpperHex implementation when Debug-formatted.
Formats each item in a sequence. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Pipes by value. This is generally the method you want to use. Read more
Borrows self and passes that borrow into the pipe function. Read more
Mutably borrows self and passes that borrow into the pipe function. Read more
Borrows self, then passes self.borrow() into the pipe function. Read more
Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Borrows self, then passes self.as_ref() into the pipe function.
Mutably borrows self, then passes self.as_mut() into the pipe function.
Borrows self, then passes self.deref() into the pipe function.
Mutably borrows self, then passes self.deref_mut() into the pipe function.
Immutable access to a value. Read more
Mutable access to a value. Read more
Immutable access to the Borrow<B> of a value. Read more
Mutable access to the BorrowMut<B> of a value. Read more
Immutable access to the AsRef<R> view of a value. Read more
Mutable access to the AsMut<R> view of a value. Read more
Immutable access to the Deref::Target of a value. Read more
Mutable access to the Deref::Target of a value. Read more
Calls .tap() only in debug builds, and is erased in release builds.
Calls .tap_mut() only in debug builds, and is erased in release builds.
Calls .tap_borrow() only in debug builds, and is erased in release builds.
Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
Calls .tap_ref() only in debug builds, and is erased in release builds.
Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
Calls .tap_deref() only in debug builds, and is erased in release builds.
Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
Attempts to convert self into T using TryInto<T>. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.