pub enum ExecutionState {
Running,
Paused(PendingQueries),
Completed {
result: Value,
},
Failed {
error: String,
},
Cancelled,
}Variants§
Running
Paused(PendingQueries)
Awaiting 1..N LLM responses.
Completed
Failed
Cancelled
Explicit cancellation by the host.
Implementations§
Source§impl ExecutionState
impl ExecutionState
pub fn is_terminal(&self) -> bool
Sourcepub fn feed(
&mut self,
id: &QueryId,
response: String,
) -> Result<bool, FeedError>
pub fn feed( &mut self, id: &QueryId, response: String, ) -> Result<bool, FeedError>
Feed a response. Only valid in Paused state.
Returns Ok(true) when all queries are complete, Ok(false) otherwise.
Sourcepub fn take_responses(&mut self) -> Result<Vec<String>, TransitionError>
pub fn take_responses(&mut self) -> Result<Vec<String>, TransitionError>
Extract responses from a complete Paused state. Transitions self to Running (preparing for Lua resumption).
Sourcepub fn pause(&mut self, queries: Vec<LlmQuery>) -> Result<(), TransitionError>
pub fn pause(&mut self, queries: Vec<LlmQuery>) -> Result<(), TransitionError>
Running → Paused (triggered by alc.llm() / alc.llm_batch()).
Sourcepub fn cancel(&mut self) -> Result<(), TransitionError>
pub fn cancel(&mut self) -> Result<(), TransitionError>
Running | Paused → Cancelled (explicit host cancellation).
Trait Implementations§
Source§impl TryFrom<ExecutionState> for TerminalState
impl TryFrom<ExecutionState> for TerminalState
Source§type Error = TransitionError
type Error = TransitionError
The type returned in the event of a conversion error.
Source§fn try_from(state: ExecutionState) -> Result<Self, TransitionError>
fn try_from(state: ExecutionState) -> Result<Self, TransitionError>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for ExecutionState
impl RefUnwindSafe for ExecutionState
impl Send for ExecutionState
impl Sync for ExecutionState
impl Unpin for ExecutionState
impl UnsafeUnpin for ExecutionState
impl UnwindSafe for ExecutionState
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