/// Ensures that answer with the given index is available from the
/// given table. This may require activating a strand. Returns
/// `Ok(())` if the answer is available and otherwise a
/// `RootSearchFail` result.
Ensures that answer with the given index is available from the
given table. This may require activating a strand. Returns
`Ok(())` if the answer is available and otherwise a
`RootSearchFail` result.
Ensures that answer with the given index is available from the given table . This may require activating a strand . Returns ` Ok (( )) ` if the answer is available and otherwise a ` RootSearchFail ` result .
pub(super) fn ensure_root_answer(
        &mut self,
        table: TableIndex,
        answer: AnswerIndex,
    ) -> RootSearchResult<()> {
        assert!(self.stack.is_empty());
        match self.ensure_answer_recursively(table, answer) {
            Ok(EnsureSuccess::AnswerAvailable) => Ok(()),
            Err(RecursiveSearchFail::NoMoreSolutions) => Err(RootSearchFail::NoMoreSolutions),
            Err(RecursiveSearchFail::QuantumExceeded) => Err(RootSearchFail::QuantumExceeded),
            // Things involving cycles should be impossible since our
            // stack was empty on entry:
            Ok(EnsureSuccess::Coinductive) | Err(RecursiveSearchFail::Cycle(..)) => {
                panic!("ensure_root_answer: nothing on the stack but cyclic result")
            }
        }
    }
pub ( super ) fn ensure_root_answer ( & mut self , table : TableIndex , answer : AnswerIndex , ) -> RootSearchResult < ( ) > { assert ! ( self stack is_empty ( ) ) ; match self . ensure_answer_recursively ( table , answer ) { Ok ( EnsureSuccess :: AnswerAvailable ) => Ok ( ( ) ) , Err ( RecursiveSearchFail :: NoMoreSolutions ) => Err ( RootSearchFail :: NoMoreSolutions ) , Err ( RecursiveSearchFail :: QuantumExceeded ) => Err ( RootSearchFail :: QuantumExceeded ) , // Things involving cycles should be impossible since our // stack was empty on entry: Ok ( EnsureSuccess :: Coinductive ) | Err ( RecursiveSearchFail :: Cycle ( .. ) ) => { panic ! ( " " ) } } }
Ensures that answer with the given index is available from the
given table.
Ensures that answer with the given index is available from the given table .
&mut self
table
TableIndex
answer
AnswerIndex