Struct stack_graphs::partial::PartialSymbolStack [−][src]
#[repr(C)]pub struct PartialSymbolStack { /* fields omitted */ }
Expand description
A pattern that might match against a symbol stack. Consists of a (possibly empty) list of partial scoped symbols.
(Note that unlike partial scope stacks, we don’t store any “symbol stack variable” here. We could! But with our current path-finding rules, every partial path will always have exactly one symbol stack variable, which will appear at the end of its precondition and postcondition. So for simplicity we just leave it out. At some point in the future we might add it in so that the symbol and scope stack formalisms and implementations are more obviously symmetric.)
Implementations
Returns an empty partial symbol stack.
Pushes a new PartialScopedSymbol
onto the front of this partial symbol stack.
Pushes a new PartialScopedSymbol
onto the back of this partial symbol stack.
Removes and returns the PartialScopedSymbol
at the front of this partial symbol
stack. If the stack is empty, returns None
.
Removes and returns the PartialScopedSymbol
at the back of this partial symbol stack.
If the stack is empty, returns None
.
pub fn display<'a>(
self,
graph: &'a StackGraph,
partials: &'a mut PartialPaths
) -> impl Display + 'a
pub fn match_stack(
self,
graph: &StackGraph,
paths: &Paths,
partial_paths: &mut PartialPaths,
stack: SymbolStack,
symbol_bindings: &mut SymbolStackBindings,
scope_bindings: &mut ScopeStackBindings
) -> Result<(), PathResolutionError>
pub fn match_stack(
self,
graph: &StackGraph,
paths: &Paths,
partial_paths: &mut PartialPaths,
stack: SymbolStack,
symbol_bindings: &mut SymbolStackBindings,
scope_bindings: &mut ScopeStackBindings
) -> Result<(), PathResolutionError>
Matches this precondition against a symbol stack, stashing away the unmatched portion of the stack in the bindings.
Returns whether two partial symbol stacks “match”. They must be the same length, and each respective partial scoped symbol must match.
pub fn apply_bindings(
self,
paths: &mut Paths,
partials: &mut PartialPaths,
symbol_bindings: &SymbolStackBindings,
scope_bindings: &ScopeStackBindings
) -> Result<SymbolStack, PathResolutionError>
pub fn apply_bindings(
self,
paths: &mut Paths,
partials: &mut PartialPaths,
symbol_bindings: &SymbolStackBindings,
scope_bindings: &ScopeStackBindings
) -> Result<SymbolStack, PathResolutionError>
Applies a set of bindings to this partial symbol stack, producing a new symbol stack.
pub fn cmp(
self,
graph: &StackGraph,
partials: &mut PartialPaths,
other: PartialSymbolStack
) -> Ordering
pub fn iter<'a>(
&self,
partials: &'a mut PartialPaths
) -> impl Iterator<Item = PartialScopedSymbol> + 'a
pub fn iter<'a>(
&self,
partials: &'a mut PartialPaths
) -> impl Iterator<Item = PartialScopedSymbol> + 'a
Returns an iterator over the contents of this partial symbol stack.
pub fn iter_unordered<'a>(
&self,
partials: &'a PartialPaths
) -> impl Iterator<Item = PartialScopedSymbol> + 'a
pub fn iter_unordered<'a>(
&self,
partials: &'a PartialPaths
) -> impl Iterator<Item = PartialScopedSymbol> + 'a
Returns an iterator over the contents of this partial symbol stack, with no guarantee about the ordering of the elements.
Trait Implementations
Performs the conversion.
Auto Trait Implementations
impl !RefUnwindSafe for PartialSymbolStack
impl Send for PartialSymbolStack
impl Sync for PartialSymbolStack
impl Unpin for PartialSymbolStack
impl UnwindSafe for PartialSymbolStack
Blanket Implementations
Mutably borrows from an owned value. Read more