everruns_host/
in_process_execution.rs1use chrono::{DateTime, Utc};
4use everruns_engine::{
5 ActivityOutcome, Execution, ExecutionTransition, HostFacts, TurnExecution, TurnState,
6};
7
8#[derive(Debug, Clone)]
13pub struct InProcessExecution {
14 inner: TurnExecution,
15}
16
17impl InProcessExecution {
18 pub fn new(state: TurnState) -> Self {
20 Self {
21 inner: TurnExecution::new(state),
22 }
23 }
24
25 pub fn into_state(self) -> TurnState {
27 self.inner.into_state()
28 }
29}
30
31impl Execution for InProcessExecution {
32 fn state(&self) -> &TurnState {
33 self.inner.state()
34 }
35
36 fn advance(
37 &mut self,
38 outcome: ActivityOutcome,
39 pending_user_message_count: usize,
40 now: DateTime<Utc>,
41 facts: HostFacts,
42 ) -> ExecutionTransition {
43 self.inner
44 .advance(outcome, pending_user_message_count, now, facts)
45 }
46}