percolate

Lib.rs Crates.io Docs.rs

Rust 1.51 CI Crates.io - License

GitHub open issues open pull requests crev reviews

Yet another async utility library.

Note: The API will likely contain incomplete permutations during these first 0.0.x versions.

I mainly work on this crate as I need it for other projects of mine, but feel free to file an issue if you'd like to see a particular feature.

Installation

Please use cargo-edit to always add the latest version of this library:

cmd cargo add percolate

Example

```rust use ergopin::ergopin; use percolate::projection::{AsyncMut, IntoProjectionMut, ProjectionMut}; use pollster::block_on; use tap::Conv;

[ergo_pin]

async fn project(value: A, projection: impl IntoProjectionMut) -> B { pin!( projection.intoprojectionmut() // impl ProjectionMut ) // Pin<&mut impl ProjectionMut> .project(value) // PinHandleMut> .await // B }

asserteq!(blockon(project(1, |x: u8| x + 1)), 2); asserteq!( blockon(project( 1, // Type inference doesn't understand this on its own (yet), unfortunately. // We can instead pass the projection pre-converted. (|x| async move { x + 1 }).conv::>()), ), 2, ); ```

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Code of Conduct

Changelog

Versioning

percolate strictly follows Semantic Versioning 2.0.0 with the following exceptions:

This includes the Rust version requirement specified above.
Earlier Rust versions may be compatible, but this can change with minor or patch releases.

Which versions are affected by features and patches can be determined from the respective headings in CHANGELOG.md.