Skip to content

Commit 2e98ea4

Browse files
committed
params defeault type
1 parent 7397c8d commit 2e98ea4

12 files changed

Lines changed: 22 additions & 98 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cano"
3-
version = "0.1.2"
3+
version = "0.1.3"
44
edition = "2024"
55
description = "Simple & Fast Async Workflows in Rust - Build powerful data processing pipelines with minimal code"
66
license = "MIT"

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ struct ProcessorNode;
3838

3939
#[async_trait]
4040
impl Node<WorkflowState> for ProcessorNode {
41-
type Params = DefaultParams;
4241
type Storage = MemoryStore;
4342
type PrepResult = String;
4443
type ExecResult = bool;
@@ -109,7 +108,6 @@ struct EmailProcessor;
109108

110109
#[async_trait]
111110
impl Node<String> for EmailProcessor {
112-
type Params = DefaultParams;
113111
type Storage = MemoryStore;
114112
type PrepResult = String;
115113
type ExecResult = bool;

benches/flow_performance.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use async_trait::async_trait;
2-
use cano::{CanoError, DefaultParams, Flow, MemoryStore, Node};
2+
use cano::{CanoError, Flow, MemoryStore, Node};
33
use criterion::{BenchmarkId, Criterion, criterion_group, criterion_main};
44

55
/// Simple do-nothing node for benchmarking
@@ -32,7 +32,6 @@ impl TestState {
3232

3333
#[async_trait]
3434
impl Node<TestState> for DoNothingNode {
35-
type Params = DefaultParams;
3635
type Storage = MemoryStore;
3736
type PrepResult = ();
3837
type ExecResult = ();

benches/node_performance.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ enum TestState {
2626

2727
#[async_trait]
2828
impl Node<TestState> for DoNothingNode {
29-
type Params = DefaultParams;
3029
type Storage = MemoryStore;
3130
type PrepResult = ();
3231
type ExecResult = ();
@@ -67,7 +66,6 @@ impl CpuIntensiveNode {
6766

6867
#[async_trait]
6968
impl Node<TestState> for CpuIntensiveNode {
70-
type Params = DefaultParams;
7169
type Storage = MemoryStore;
7270
type PrepResult = Vec<u64>;
7371
type ExecResult = u64;
@@ -111,7 +109,6 @@ impl IoSimulationNode {
111109

112110
#[async_trait]
113111
impl Node<TestState> for IoSimulationNode {
114-
type Params = DefaultParams;
115112
type Storage = MemoryStore;
116113
type PrepResult = String;
117114
type ExecResult = String;

examples/book_prepositions.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,11 @@ impl BookDownloaderNode {
263263

264264
#[async_trait]
265265
impl Node<BookPrepositionAction> for BookDownloaderNode {
266-
type Params = HashMap<String, String>;
267266
type Storage = MemoryStore;
268267
type PrepResult = Vec<(u32, String, String)>;
269268
type ExecResult = Vec<Book>;
270269

271-
fn set_params(&mut self, params: Self::Params) {
270+
fn set_params(&mut self, params: HashMap<String, String>) {
272271
self.params = params;
273272
}
274273

@@ -405,12 +404,11 @@ impl PrepositionNode {
405404

406405
#[async_trait]
407406
impl Node<BookPrepositionAction> for PrepositionNode {
408-
type Params = HashMap<String, String>;
409407
type Storage = MemoryStore;
410408
type PrepResult = Vec<Book>;
411409
type ExecResult = Vec<BookAnalysis>;
412410

413-
fn set_params(&mut self, params: Self::Params) {
411+
fn set_params(&mut self, params: HashMap<String, String>) {
414412
self.params = params;
415413
}
416414

@@ -493,12 +491,11 @@ impl BookRankingByPrepositionNode {
493491

494492
#[async_trait]
495493
impl Node<BookPrepositionAction> for BookRankingByPrepositionNode {
496-
type Params = HashMap<String, String>;
497494
type Storage = MemoryStore;
498495
type PrepResult = Vec<BookAnalysis>;
499496
type ExecResult = Vec<BookRanking>;
500497

501-
fn set_params(&mut self, params: Self::Params) {
498+
fn set_params(&mut self, params: HashMap<String, String>) {
502499
self.params = params;
503500
}
504501

examples/negotiation.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,11 @@ impl SellerNode {
7777

7878
#[async_trait]
7979
impl Node<NegotiationAction> for SellerNode {
80-
type Params = HashMap<String, String>;
8180
type Storage = MemoryStore;
8281
type PrepResult = NegotiationState;
8382
type ExecResult = NegotiationState;
8483

85-
fn set_params(&mut self, params: Self::Params) {
84+
fn set_params(&mut self, params: HashMap<String, String>) {
8685
self.params = params;
8786
}
8887

@@ -194,12 +193,11 @@ impl BuyerNode {
194193

195194
#[async_trait]
196195
impl Node<NegotiationAction> for BuyerNode {
197-
type Params = HashMap<String, String>;
198196
type Storage = MemoryStore;
199197
type PrepResult = NegotiationState;
200198
type ExecResult = (NegotiationState, bool);
201199

202-
fn set_params(&mut self, params: Self::Params) {
200+
fn set_params(&mut self, params: HashMap<String, String>) {
203201
self.params = params;
204202
}
205203

examples/simple.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,11 @@ impl GeneratorNode {
4141

4242
#[async_trait]
4343
impl Node<WorkflowAction> for GeneratorNode {
44-
type Params = HashMap<String, String>;
4544
type Storage = MemoryStore;
4645
type PrepResult = Vec<u32>;
4746
type ExecResult = Vec<u32>;
4847

49-
fn set_params(&mut self, params: Self::Params) {
48+
fn set_params(&mut self, params: HashMap<String, String>) {
5049
self.params = params;
5150
}
5251

@@ -114,12 +113,11 @@ impl CounterNode {
114113

115114
#[async_trait]
116115
impl Node<WorkflowAction> for CounterNode {
117-
type Params = HashMap<String, String>;
118116
type Storage = MemoryStore;
119117
type PrepResult = Vec<u32>;
120118
type ExecResult = usize;
121119

122-
fn set_params(&mut self, params: Self::Params) {
120+
fn set_params(&mut self, params: HashMap<String, String>) {
123121
self.params = params;
124122
}
125123

src/flow.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ where
144144
///
145145
/// #[async_trait]
146146
/// impl Node<WorkflowState> for StartNode {
147-
/// type Params = DefaultParams;
148147
/// type Storage = MemoryStore;
149148
/// type PrepResult = String;
150149
/// type ExecResult = bool;
@@ -169,7 +168,6 @@ where
169168
///
170169
/// #[async_trait]
171170
/// impl Node<WorkflowState> for ProcessNode {
172-
/// type Params = DefaultParams;
173171
/// type Storage = MemoryStore;
174172
/// type PrepResult = i32;
175173
/// type ExecResult = i32;
@@ -375,7 +373,6 @@ mod tests {
375373
use super::*;
376374
use crate::store::{MemoryStore, StoreTrait};
377375
use async_trait::async_trait;
378-
use std::collections::HashMap;
379376
use std::sync::Arc;
380377
use std::sync::atomic::{AtomicU32, Ordering};
381378
use tokio;
@@ -414,7 +411,6 @@ mod tests {
414411

415412
#[async_trait]
416413
impl Node<TestState> for SuccessNode {
417-
type Params = HashMap<String, String>;
418414
type Storage = MemoryStore;
419415
type PrepResult = String;
420416
type ExecResult = bool;
@@ -465,7 +461,6 @@ mod tests {
465461

466462
#[async_trait]
467463
impl Node<TestState> for FailureNode {
468-
type Params = HashMap<String, String>;
469464
type Storage = MemoryStore;
470465
type PrepResult = String;
471466
type ExecResult = bool;
@@ -507,7 +502,6 @@ mod tests {
507502

508503
#[async_trait]
509504
impl Node<TestState> for DataStoringNode {
510-
type Params = HashMap<String, String>;
511505
type Storage = MemoryStore;
512506
type PrepResult = ();
513507
type ExecResult = String;
@@ -557,7 +551,6 @@ mod tests {
557551

558552
#[async_trait]
559553
impl Node<TestState> for ConditionalNode {
560-
type Params = HashMap<String, String>;
561554
type Storage = MemoryStore;
562555
type PrepResult = String;
563556
type ExecResult = bool;

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ pub mod store;
7979
// Core public API - simplified imports
8080
pub use error::{CanoError, CanoResult};
8181
pub use flow::{Flow, FlowBuilder};
82-
pub use node::{DefaultNodeResult, DefaultParams, DynNode, Node, NodeConfig, Params};
82+
pub use node::{DefaultNodeResult, DefaultParams, DynNode, Node, NodeConfig};
8383
pub use store::{MemoryStore, StoreTrait};
8484

8585
// Convenience re-exports for common patterns

0 commit comments

Comments
 (0)