#future #cross-platform #executor #io #platform-agnostic

no-std pasts

Minimal and simpler alternative to the futures crate

23 releases (14 breaking)

0.14.3 Jun 2, 2023
0.14.2 Mar 3, 2023
0.14.1 Feb 20, 2023
0.12.0 Jul 31, 2022
0.0.1 Dec 19, 2019

#192 in Asynchronous

Download history 46/week @ 2023-11-20 64/week @ 2023-11-27 46/week @ 2023-12-04 59/week @ 2023-12-11 81/week @ 2023-12-18 28/week @ 2023-12-25 11/week @ 2024-01-01 59/week @ 2024-01-08 38/week @ 2024-01-15 42/week @ 2024-01-22 21/week @ 2024-01-29 33/week @ 2024-02-05 107/week @ 2024-02-12 130/week @ 2024-02-19 177/week @ 2024-02-26 108/week @ 2024-03-04

526 downloads per month
Used in 16 crates (15 directly)

Apache-2.0 OR BSL-1.0 OR MIT

30KB
492 lines

Pasts

Changelog | Source | Getting Started

tests GitHub commit activity GitHub contributors
Crates.io Crates.io Crates.io (recent)
Crates.io Docs.rs

Minimal and simpler alternative to the futures crate.

The pasts asynchronous runtime is designed for creating user-space software and embedded software using an asynchronous event loop. It aims to abstract away all of the pain points of using asynchronous Rust. Pasts is purposely kept small with the entire source directory under 500 lines of Rust code.

Check out the documentation for examples.

Goals

  • No unsafe (safe and sound)
  • No required std (executor requires two allocations at startup, if needed can use a bump allocator with small capacity)
  • No macros (fast compile times)
  • No dependencies[^1] (bloat-free)
  • No cost (true zero-cost abstractions)
  • No pain (API super easy to learn & use)
  • No platform-specific API differences (code works everywhere).

Supported Platforms

Pasts targets all platforms that can run Rust. The executor works on at least the following platforms (may work on others):

  • All platforms that support threading (includes all tier 1 and some tier 2, 3)
  • Web Assembly In Browser (Tier 2)
  • No standard devices (Tiers 2 and 3)

License

Copyright © 2019-2023 The Pasts Contributors.

Licensed under any 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 licensed as described above, without any additional terms or conditions.

Help

If you want help using or contributing to this library, feel free to send me an email at aldaronlau@gmail.com.

Since pasts is not an all-in-one async runtime solution, here's a list of crates that are designed to work well with pasts:

  • Async Main - Proc macro crate to remove boilerplate for the main function
  • Whisk - No-std compatible MPMC (multi-producer/multiple-consumer) asynchronous channel
  • Smelling Salts - Library for asynchronous device waking using OS APIs
  • Lookit - Library for asynchronously connecting to devices using OS APIs

[^1]: Some features require a platform integration dependency, for instance: - web pulls in wasm-bindgen-futures

Dependencies

~0–1.3MB
~26K SLoC