pub struct LoopEngine { /* private fields */ }Expand description
Binds a LoopSpec to the live pieces it needs to run: a model, the
maker/checker tool sets, an isolation sandbox, a gate, and (optionally)
memory for the state spine.
Implementations§
Source§impl LoopEngine
impl LoopEngine
Sourcepub fn new(spec: LoopSpec, model: Arc<dyn Model>) -> Self
pub fn new(spec: LoopSpec, model: Arc<dyn Model>) -> Self
Construct an engine. By default the maker and checker run with no
tools, in a NullSandbox rooted at the current directory, with the
gate the spec’s level implies (AlwaysEscalate for L1/L2). Override
any of these with the builder methods.
pub fn with_maker_tool(self, t: Arc<dyn Tool>) -> Self
pub fn with_checker_tool(self, t: Arc<dyn Tool>) -> Self
pub fn with_sandbox(self, s: Arc<dyn Sandbox>) -> Self
pub fn with_gate(self, g: Arc<dyn HumanGate>) -> Self
pub fn with_action_executor(self, e: Arc<dyn ActionExecutor>) -> Self
pub fn with_memory(self, m: Arc<dyn Memory>) -> Self
pub fn spec(&self) -> &LoopSpec
Sourcepub async fn run_once(&self) -> RoundReport
pub async fn run_once(&self) -> RoundReport
Run exactly one round of the loop. Never panics and never returns an
Err: sandbox/maker/checker failures are folded into
RoundOutcome::Failed so a scheduler can keep ticking. The result
is also recorded to memory when memory is configured.
Auto Trait Implementations§
impl !RefUnwindSafe for LoopEngine
impl !UnwindSafe for LoopEngine
impl Freeze for LoopEngine
impl Send for LoopEngine
impl Sync for LoopEngine
impl Unpin for LoopEngine
impl UnsafeUnpin for LoopEngine
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