Expand description
Typed source-transform-sink pipelines with backpressure, batching, and per-stage error isolation. A lightweight runtime-agnostic stream processor for in-process workloads. The missing middle ground between raw iterators and full distributed stream processing.
§Quick start
use pipe_io::{Pipeline, sink::VecSink};
let sink = VecSink::<i64>::new();
let handle = sink.handle();
Pipeline::from_iter(1..=5)
.map(|n: i32| i64::from(n) * 10)
.filter(|n: &i64| *n > 20)
.sink(sink)
.run()
.expect("pipeline run");
assert_eq!(handle.take(), vec![30, 40, 50]);§Features
std(default): enablessource::ChannelSource,source::ReaderSource,sink::ChannelSink,sink::WriterSink, anddriver::ThreadedDriver. Withstddisabled the crate compiles inno_stdmode (requiresalloc) with the data primitives, closure-based adapters, batching, anddriver::SyncDriveravailable.
§Design notes
Sources are pull-based (Source::pull). Stages receive items one at
a time and emit zero or more outputs via an Emit callback handed
in by the driver. Sinks are push-based (Sink::write). The
builder is fully typed; the carrier type of the pipeline is tracked
at compile time across every stage transition. See REPS.md for the
binding API contract and .dev/DESIGN.md for design notes.
Re-exports§
pub use crate::batch::Batch;pub use crate::batch::BatchPolicy;pub use crate::batch::ByteSize;pub use crate::driver::Driver;pub use crate::driver::RunStats;pub use crate::emit::Emit;pub use crate::emit::EmitError;pub use crate::error::BoxError;pub use crate::error::Error;pub use crate::error::ErrorPolicy;pub use crate::error::Result;pub use crate::error::StageError;pub use crate::error::StageFailure;pub use crate::sink::Sink;pub use crate::source::Source;pub use crate::stage::Stage;pub use crate::window::Clock;stdpub use crate::window::SystemClock;stdpub use crate::window::Window;stdpub use crate::window::WindowPolicy;std
Modules§
- batch
- Batching primitives:
BatchPolicy,Batch, andByteSize. - driver
- Pipeline execution drivers.
- emit
- The
Emittrait and its error type. - error
- Error model for
pipe-io. - sink
- The
Sinktrait and built-in sink adapters. - source
- The
Sourcetrait and built-in source adapters. - stage
- The
Stagetrait. - window
std - Windowing primitives:
Clock,SystemClock,WindowPolicy, andWindow<T>.
Structs§
- Pipeline
- A built pipeline. Run with
Pipeline::run(sync) orPipeline::run_threaded(std). - Pipeline
Builder - Typed builder. Each transformer changes the carrier type
T. - StageId
- Identifier for a pipeline stage. Carried by
crate::Errorvariants and bycrate::StageFailureso a consumer can route or log by stage name.
Constants§
- VERSION
- Crate version string, populated by Cargo at build time.