fluent_pipeline 0.1.0

A lightweight pipeline system for Rust.
Documentation
  • Coverage
  • 46.15%
    6 out of 13 items documented0 out of 10 items with examples
  • Size
  • Source code size: 5.16 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 395.4 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • m1guelpf/pipeline-rs
    2 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • m1guelpf

Pipeline for Rust

crates.io download count badge docs.rs

A convenient way to "pipe" a given input through a series of invokable classes, closures, or callables, giving each class the opportunity to inspect or modify the input and invoke the next callable in the pipeline.

Usage

To get started, create a new pipeline with the send method, passing the input you want to pipe through the pipeline. Then, use the through method to add a series of pipes (either classes implenting the Pipe trait, or closures) to the pipeline. Finally, call the then method to transform and get the final output.

You can also append Pipes to an existing pipeline using the pipe method, or use thenReturn to get the final output without transforming it.

use fluent_pipeline::Pipeline;

Pipeline::send(project).through(&[
    PipeType::Pipe(BuildProject()),
    PipeType::Pipe(UploadProject()),
    PipeType::Pipe(DeployProject()),
    PipeType::Fn(|project| {
        // ...

        return project
    })
]).run()

License

This project is licensed under the MIT License - see the LICENSE file for details.