callbag.rs 👜
Experimental callbag implementation in Rust
pipe!(
from_iter(0..10),
map(|x| x * 3),
filter(|x| x % 2 == 0),
map(|x| format!("The number is {}", x)),
for_each(|x| println!("{}", x))
);Testing
Run tests with cargo test -- --nocapture to see output.
API
The list below shows what's currently implemented/being attempted.
Source factories
-
from_iter -
interval
Sink factories
-
for_each
Transformation operators
-
map -
scan -
flatten
Filtering operators
-
take -
take_until -
take_while -
take_until_interval -
skip -
skip_until -
skip_while -
filter
Combination operators
-
merge- variadic with macromerge! -
concat -
combine- tough one, need to flatten tuples
Utilities
-
pipe- variadic with macropipe!