Skip to main content

ironflow_engine/
operation.rs

1//! [`Operation`] trait re-exported from [`ironflow_core::operation`].
2//!
3//! The canonical definitions live in `ironflow-core` so that external crates
4//! can implement [`Operation`] without depending on `ironflow-engine`.
5//! This module re-exports them for backward compatibility.
6//!
7//! # Examples
8//!
9//! ```no_run
10//! use ironflow_engine::operation::Operation;
11//! use ironflow_core::operation::OperationContext;
12//! use ironflow_core::error::OperationError;
13//! use serde_json::{Value, json};
14//! use std::future::Future;
15//! use std::pin::Pin;
16//!
17//! struct CreateGitlabIssue {
18//!     project_id: u64,
19//!     title: String,
20//! }
21//!
22//! impl Operation for CreateGitlabIssue {
23//!     fn kind(&self) -> &str {
24//!         "gitlab"
25//!     }
26//!
27//!     fn execute<'a>(
28//!         &'a self,
29//!         _ctx: &'a OperationContext,
30//!     ) -> Pin<Box<dyn Future<Output = Result<Value, OperationError>> + Send + 'a>> {
31//!         Box::pin(async move {
32//!             Ok(json!({"issue_id": 42, "url": "https://gitlab.com/issues/42"}))
33//!         })
34//!     }
35//! }
36//! ```
37
38pub use ironflow_core::operation::{
39    NoopSecretResolver, Operation, OperationContext, SecretResolver, SecretValue, TypedOperation,
40};