#[repr(C)]
pub struct PartialPath { pub start_node: Handle<Node>, pub end_node: Handle<Node>, pub symbol_stack_precondition: PartialSymbolStack, pub symbol_stack_postcondition: PartialSymbolStack, pub scope_stack_precondition: PartialScopeStack, pub scope_stack_postcondition: PartialScopeStack, pub edges: PartialPathEdgeList, }
Expand description

A portion of a name-binding path.

Partial paths can be computed incrementally, in which case all of the edges in the partial path belong to a single file. At query time, we can efficiently concatenate partial paths to yield a name-binding path.

Paths describe the contents of the symbol stack and scope stack at the end of the path. Partial paths, on the other hand, have preconditions and postconditions for each stack. The precondition describes what the stack must look like for us to be able to concatenate this partial path onto the end of a path. The postcondition describes what the resulting stack looks like after doing so.

The preconditions can contain scope stack variables, which describe parts of the scope stack (or parts of a scope symbol’s attached scope list) whose contents we don’t care about. The postconditions can also refer to those variables, and describe how those variable parts of the input scope stacks are carried through unmodified into the resulting scope stack.

Fields

start_node: Handle<Node>end_node: Handle<Node>symbol_stack_precondition: PartialSymbolStacksymbol_stack_postcondition: PartialSymbolStackscope_stack_precondition: PartialScopeStackscope_stack_postcondition: PartialScopeStackedges: PartialPathEdgeList

Implementations

Creates a new empty partial path starting at a stack graph node.

Returns whether one path shadows another. Note that shadowing is not commutative — if path A shadows path B, the reverse is not true.

Returns whether a partial path represents the start of a name binding from a reference to a definition.

Returns whether a partial path represents the end of a name binding from a reference to a definition.

A complete partial path represents a full name binding that resolves a reference to a definition.

A partial path is as complete as possible if we cannot extend it any further within the current file. This represents the maximal amount of work that we can pre-compute at index time.

Returns whether a partial path is “productive” — that is, whether it adds useful information to a path. Non-productive paths are ignored.

Ensures that the content of this partial path is available in both forwards and backwards directions.

Ensures that the content of this partial path is in forwards direction.

Returns the largest value of any symbol stack variable in this partial path.

Returns the largest value of any scope stack variable in this partial path.

Returns a fresh scope stack variable that is not already used anywhere in this partial path.

Modifies this partial path so that it has no symbol or scope stack variables in common with another partial path.

Attempts to append an edge to the end of a partial path. If the edge is not a valid extension of this partial path, we return an error describing why.

Attempts to resolve any jump to scope node at the end of a partial path. If the partial path does not end in a jump to scope node, we do nothing. If it does, and we cannot resolve it, then we return an error describing why.

Attempts to extend one partial path as part of the partial-path-finding algorithm, using only outgoing edges that belong to a particular file. When calling this function, you are responsible for ensuring that graph already contains data for all of the possible edges that we might want to extend path with.

The resulting extended partial paths will be added to result. We have you pass that in as a parameter, instead of building it up ourselves, so that you have control over which particular collection type to use, and so that you can reuse result collections across multiple calls.

Attempts to concatenate two partial paths. If the postcondition of the “left” partial path is not compatible with the precondition of the “right” path, we return an error describing why.

If the left- and right-hand partial paths have any symbol or scope stack variables in common, then we ensure that the variables bind to the same values on both sides. It’s your responsibility to update the two partial paths so that they have no variables in common, if that’s needed for your use case.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Converts this type into the (usually inferred) input type.

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. Read more

Causes self to use its LowerExp implementation when Debug-formatted. Read more

Causes self to use its LowerHex implementation when Debug-formatted. Read more

Causes self to use its Octal implementation when Debug-formatted.

Causes self to use its Pointer implementation when Debug-formatted. Read more

Causes self to use its UpperExp implementation when Debug-formatted. Read more

Causes self to use its UpperHex implementation when Debug-formatted. 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. Read more

Borrows self, then passes self.deref() into the pipe function.

Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more

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. Read more

Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

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.