pub struct FixedPointStack<Input, Output> { /* private fields */ }
Implementations§
Source§impl<Input, Output> FixedPointStack<Input, Output>
impl<Input, Output> FixedPointStack<Input, Output>
Sourcepub fn search(&mut self, input: &Input) -> Option<Output>
pub fn search(&mut self, input: &Input) -> Option<Output>
Search backwards through the stack, looking for the given input.
If it is found, return Some
with the current outputs, and mark it
as needing fixed point iteration.
If not, return None
.
The fixed-point mark is returned when the stack is popped and is used as part of the fixed point algorithm.
Sourcepub fn push(&mut self, input: &Input, output: Output)
pub fn push(&mut self, input: &Input, output: Output)
Push an entry onto the stack, indicating it is currently being evaluated.
There must not already be an entry for input
.
Sourcepub fn update_output(&mut self, input: &Input, output: Output) -> bool
pub fn update_output(&mut self, input: &Input, output: Output) -> bool
Add outputs to the top-most stack entry, which must be for input
.
Returns true if another iteration is needed before reaching a fixed point.
Trait Implementations§
Auto Trait Implementations§
impl<Input, Output> Freeze for FixedPointStack<Input, Output>
impl<Input, Output> RefUnwindSafe for FixedPointStack<Input, Output>where
Input: RefUnwindSafe,
Output: RefUnwindSafe,
impl<Input, Output> Send for FixedPointStack<Input, Output>
impl<Input, Output> Sync for FixedPointStack<Input, Output>
impl<Input, Output> Unpin for FixedPointStack<Input, Output>
impl<Input, Output> UnwindSafe for FixedPointStack<Input, Output>where
Input: UnwindSafe,
Output: 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