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
sourceimpl<I: Interner> Stack<I>
impl<I: Interner> Stack<I>
pub(crate) fn debug_with<'a>(
&'a self,
tables: &'a Tables<I>
) -> StackDebug<'_, I>
sourceimpl<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
sourceimpl<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.
sourcefn index(&self, index: StackIndex) -> &StackEntry<I>
fn index(&self, index: StackIndex) -> &StackEntry<I>
Performs the indexing (container[index]
) operation. Read more
sourceimpl<I: Interner> IndexMut<StackIndex> for Stack<I>
impl<I: Interner> IndexMut<StackIndex> for Stack<I>
sourcefn 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 more
Auto Trait Implementations
impl<I> RefUnwindSafe for Stack<I> where
<I as Interner>::InternedCanonicalVarKinds: RefUnwindSafe,
<I as Interner>::InternedGoal: RefUnwindSafe,
<I as Interner>::InternedLifetime: RefUnwindSafe,
<I as Interner>::InternedProgramClauses: RefUnwindSafe,
<I as Interner>::InternedSubstitution: RefUnwindSafe,
<I as Interner>::InternedType: RefUnwindSafe,
impl<I> Send for Stack<I> where
<I as Interner>::InternedCanonicalVarKinds: Send,
<I as Interner>::InternedGoal: Send,
<I as Interner>::InternedLifetime: Send,
<I as Interner>::InternedProgramClauses: Send,
<I as Interner>::InternedSubstitution: Send,
<I as Interner>::InternedType: Send,
impl<I> Sync for Stack<I> where
<I as Interner>::InternedCanonicalVarKinds: Sync,
<I as Interner>::InternedGoal: Sync,
<I as Interner>::InternedLifetime: Sync,
<I as Interner>::InternedProgramClauses: Sync,
<I as Interner>::InternedSubstitution: Sync,
<I as Interner>::InternedType: Sync,
impl<I> Unpin for Stack<I> where
<I as Interner>::InternedCanonicalVarKinds: Unpin,
<I as Interner>::InternedGoal: Unpin,
<I as Interner>::InternedLifetime: Unpin,
<I as Interner>::InternedProgramClauses: Unpin,
<I as Interner>::InternedSubstitution: Unpin,
<I as Interner>::InternedType: Unpin,
impl<I> UnwindSafe for Stack<I> where
<I as Interner>::InternedCanonicalVarKinds: UnwindSafe,
<I as Interner>::InternedGoal: UnwindSafe,
<I as Interner>::InternedLifetime: UnwindSafe,
<I as Interner>::InternedProgramClauses: UnwindSafe,
<I as Interner>::InternedSubstitution: UnwindSafe,
<I as Interner>::InternedType: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Cast for T
impl<T> Cast for T
sourcefn cast<U>(self, interner: <U as HasInterner>::Interner) -> U where
Self: CastTo<U>,
U: HasInterner,
fn cast<U>(self, interner: <U as HasInterner>::Interner) -> U where
Self: CastTo<U>,
U: HasInterner,
Cast a value to type U
using CastTo
.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more