// SPDX-License-Identifier: LGPL-3.0-only
#![allow(missing_docs)]
//! Pluggable process execution engine.
//!
//! The ring asks the provider for the next process step on each cycle.
//! The `Advance` and `Halt` variants carry lexicon-coordinate strings
//! naming the next state or the halt reason; the application defines
//! what state coordinates exist.
use crate::quad::Tree;
/// The outcome of one engine step.
pub enum ProcessStep {
/// Stay in the current state.
Continue,
/// Advance to the named next state.
Advance(String),
/// Halt with the given reason.
Halt(String),
}
/// Pluggable process execution engine.
pub trait ProcessEngine: Send + Sync {
fn step(&self, state: &Tree) -> ProcessStep;
}
/// No-op default — always continues; no transitions.
pub struct LinearProcess;
impl ProcessEngine for LinearProcess {
fn step(&self, _state: &Tree) -> ProcessStep {
ProcessStep::Continue
}
}