From dc8348b843e0263347ca13d8675f309b127a5b93 Mon Sep 17 00:00:00 2001 From: bakaq Date: Sun, 29 Sep 2024 23:42:11 -0300 Subject: [PATCH] Add interfaces for QueryState methods --- src/machine/lib_machine.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/machine/lib_machine.rs b/src/machine/lib_machine.rs index 5f0f4213..04cfb55c 100644 --- a/src/machine/lib_machine.rs +++ b/src/machine/lib_machine.rs @@ -23,6 +23,25 @@ pub struct QueryState<'a> { called: bool, } +impl QueryState<'_> { + /// True if the query fails. + /// + /// Consumes the query. Gives [`false`] if an exception occurs. + pub fn fails(&mut self) -> bool { + todo!() + } + + /// True if the query maybe succeeded. + /// + /// If a leaf answer has residual goals, it's only successful if the constraints they represent + /// are satisfiable. + /// + /// Consumes the query. Gives [`false`] if an exception occurs. + pub fn maybe_suceeded() -> bool { + todo!() + } +} + impl Drop for QueryState<'_> { fn drop(&mut self) { // This may be wrong if the iterator is not fully consumend, but from testing it seems -- 2.54.0