1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
//! # PocketFlow
//!
//! PocketFlow is a lightweight, composable workflow library for Rust that provides
//! both synchronous and asynchronous execution patterns for data processing pipelines.
//!
//! ## Features
//!
//! - **Composable workflows**: Build complex data processing pipelines from simple nodes
//! - **Synchronous and asynchronous support**: Choose the execution model that fits your needs
//! - **Batch processing**: Process multiple items efficiently
//! - **Parallel execution**: Take advantage of multi-core systems
//!
//! ## Examples
//!
//! ### Simple synchronous flow
//!
//! ```rust
//! use pocketflow_rs::{Flow, Node};
//! use serde_json::json;
//!
//! // Create a simple processing node
//! let node = Node::new(|data| {
//! // Process the data
//! let result = json!({"processed": data});
//! Ok(result)
//! });
//!
//! // Create a flow with the node
//! let mut flow = Flow::new();
//! flow.add_node(node);
//!
//! // Run the flow with input data
//! let input = json!({"input": "value"});
//! let result = flow.run(&input).unwrap();
//! ```
//!
//! ### Asynchronous flow
//!
//! ```rust
//! use pocketflow_rs::{AsyncFlow, AsyncNode};
//! use serde_json::json;
//!
//! # async fn run_example() {
//! // Create an async processing node
//! let node = AsyncNode::new(|data| {
//! Box::pin(async move {
//! // Asynchronous processing
//! let result = json!({"processed": data});
//! Ok(result)
//! })
//! });
//!
//! // Create an async flow with the node
//! let mut flow = AsyncFlow::new();
//! flow.add_node(node);
//!
//! // Run the flow with input data
//! let input = json!({"input": "value"});
//! let result = flow.run_async(&input).await.unwrap();
//! # }
//! ```
/// Internal module for flow implementations.
/// Internal module for macros.
/// Internal module for node implementations.
/// Internal module for type definitions.
// Re-export the public API with more specific exports
/// Asynchronous flow implementations for creating complex data processing pipelines.
pub use ;
// Re-export flow components with more specific names
/// Synchronous flow implementations for creating data processing pipelines.
pub use ;
// Re-export node components with more specific names
/// Base node traits that define the core behavior of processing nodes.
pub use ;
/// Node implementations for both synchronous and asynchronous data processing.
pub use ;
/// Common types and constants used throughout the library.
pub use *;
// Tests remain in the main file for simplicity