jellyflow_runtime/runtime/xyflow/
store.rs1use crate::runtime::store::{DispatchError, DispatchOutcome, NodeGraphStore};
4use crate::runtime::xyflow::changes::{ChangesToTransactionError, NodeGraphChanges};
5
6#[derive(Debug, thiserror::Error)]
7pub enum DispatchChangesError {
8 #[error(transparent)]
9 Changes(#[from] ChangesToTransactionError),
10 #[error(transparent)]
11 Dispatch(#[from] DispatchError),
12}
13
14impl NodeGraphStore {
15 pub fn dispatch_changes(
17 &mut self,
18 changes: &NodeGraphChanges,
19 ) -> Result<DispatchOutcome, DispatchChangesError> {
20 let tx = changes.to_transaction(self.graph())?;
21 Ok(self.dispatch_transaction(&tx)?)
22 }
23}