tirea_contract/runtime/run/
delta.rs

1use crate::runtime::state::SerializedStateAction;
2use crate::thread::Message;
3use std::sync::Arc;
4use tirea_state::TrackedPatch;
5
6/// Incremental output from a run step — the new messages, patches, and
7/// serialized state actions accumulated since the last `take_delta()`.
8#[derive(Debug, Clone, Default)]
9pub struct RunDelta {
10    pub messages: Vec<Arc<Message>>,
11    pub patches: Vec<TrackedPatch>,
12    pub state_actions: Vec<SerializedStateAction>,
13}
14
15impl RunDelta {
16    /// Returns true if there are no new messages, patches, or serialized state actions.
17    pub fn is_empty(&self) -> bool {
18        self.messages.is_empty() && self.patches.is_empty() && self.state_actions.is_empty()
19    }
20}