Struct chalk_engine::stack::Stack
source · pub(crate) struct Stack<I: Interner> {
stack: Vec<StackEntry<I>>,
}
Expand description
See Forest
.
Fields§
§stack: Vec<StackEntry<I>>
Stack: as described above, stores the in-progress goals.
Implementations§
source§impl<I: Interner> Stack<I>
impl<I: Interner> Stack<I>
pub(crate) fn debug_with<'a>( &'a self, tables: &'a Tables<I>, ) -> StackDebug<'_, I>
source§impl<I: Interner> Stack<I>
impl<I: Interner> Stack<I>
pub(crate) fn is_empty(&self) -> bool
sourcepub(crate) fn is_active(&self, table: TableIndex) -> Option<StackIndex>
pub(crate) fn is_active(&self, table: TableIndex) -> Option<StackIndex>
Searches the stack to see if table
is active. If so, returns
its stack index.
pub(crate) fn top_of_stack_from(&self, depth: StackIndex) -> Range<StackIndex>
pub(crate) fn push( &mut self, table: TableIndex, cyclic_minimums: Minimums, clock: TimeStamp, ) -> StackIndex
sourcefn pop_and_adjust_depth(&mut self) -> bool
fn pop_and_adjust_depth(&mut self) -> bool
Pops the top-most entry from the stack:
- If the stack is now empty, returns false.
- Otherwise, returns true.
sourcepub(crate) fn pop_and_take_caller_strand(
&mut self,
) -> Option<Canonical<Strand<I>>>
pub(crate) fn pop_and_take_caller_strand( &mut self, ) -> Option<Canonical<Strand<I>>>
Pops the top-most entry from the stack, which should have the depth *depth
:
- If the stack is now empty, returns None.
- Otherwise,
take
s the active strand from the new top and returns it.
sourcepub(crate) fn pop_and_borrow_caller_strand(
&mut self,
) -> Option<&mut Canonical<Strand<I>>>
pub(crate) fn pop_and_borrow_caller_strand( &mut self, ) -> Option<&mut Canonical<Strand<I>>>
Pops the top-most entry from the stack, which should have the depth *depth
:
- If the stack is now empty, returns None.
- Otherwise, borrows the active strand (mutably) from the new top and returns it.
pub(crate) fn top(&mut self) -> &mut StackEntry<I>
Trait Implementations§
source§impl<I: Interner> Index<StackIndex> for Stack<I>
impl<I: Interner> Index<StackIndex> for Stack<I>
§type Output = StackEntry<I>
type Output = StackEntry<I>
The returned type after indexing.
source§fn index(&self, index: StackIndex) -> &StackEntry<I>
fn index(&self, index: StackIndex) -> &StackEntry<I>
Performs the indexing (
container[index]
) operation. Read moresource§impl<I: Interner> IndexMut<StackIndex> for Stack<I>
impl<I: Interner> IndexMut<StackIndex> for Stack<I>
source§fn index_mut(&mut self, index: StackIndex) -> &mut StackEntry<I>
fn index_mut(&mut self, index: StackIndex) -> &mut StackEntry<I>
Performs the mutable indexing (
container[index]
) operation. Read moreAuto Trait Implementations§
impl<I> Freeze for Stack<I>
impl<I> RefUnwindSafe for Stack<I>where
<I as Interner>::InternedCanonicalVarKinds: RefUnwindSafe,
<I as Interner>::InternedSubstitution: RefUnwindSafe,
<I as Interner>::InternedGoal: RefUnwindSafe,
<I as Interner>::InternedProgramClauses: RefUnwindSafe,
<I as Interner>::InternedLifetime: RefUnwindSafe,
<I as Interner>::InternedType: RefUnwindSafe,
impl<I> Send for Stack<I>
impl<I> Sync for Stack<I>
impl<I> Unpin for Stack<I>
impl<I> UnwindSafe for Stack<I>where
<I as Interner>::InternedCanonicalVarKinds: UnwindSafe,
<I as Interner>::InternedSubstitution: UnwindSafe,
<I as Interner>::InternedGoal: UnwindSafe,
<I as Interner>::InternedProgramClauses: UnwindSafe,
<I as Interner>::InternedLifetime: UnwindSafe,
<I as Interner>::InternedType: UnwindSafe,
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
Mutably borrows from an owned value. Read more