MCPcopy Index your code
hub / github.com/ardaku/pasts

github.com/ardaku/pasts @v0.14.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.14.3 ↗ · + Follow
88 symbols 160 edges 16 files 15 documented · 17%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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 - Apache License, Version 2.0, (LICENSE_APACHE_2_0.txt or https://www.apache.org/licenses/LICENSE-2.0) - Boost Software License, Version 1.0, (LICENSE_BOOST_1_0.txt or https://www.boost.org/LICENSE_1_0.txt) - MIT License, (LICENSE_MIT.txt or https://mit-license.org/)

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.

Related Projects

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

Extension points exported contracts — how you extend this code

Notify (Interface)
Trait for asynchronous event notification Similar to [`AsyncIterator`](core::async_iter::AsyncIterator), but infinite. [11 …
src/notify.rs
Pool (Interface)
``` [2 implementers]
src/spawn.rs
Stateful (Interface)
(no doc) [2 implementers]
src/loop.rs
NotifyExt (Interface)
An extension trait for [`Notify`]s that provides a variety of convenient adapters. [1 implementers]
src/notify.rs
Park (Interface)
Trait for implementing the parking / unparking threads. [2 implementers]
src/spawn.rs
Fuse (Interface)
Trait for "fusing" a [`Future`] (conversion to a [`Notify`]) [1 implementers]
src/notify.rs

Core symbols most depended-on inside this repo

block_on
called by 10
src/spawn.rs
sleep
called by 8
examples/spawn.rs
fuse
called by 6
src/notify.rs
print
called by 6
examples/no-std/src/main.rs
on
called by 5
src/loop.rs
clone
called by 5
src/spawn.rs
spawn_boxed
called by 4
src/spawn.rs
poll_next
called by 3
src/notify.rs

Shape

Method 35
Function 25
Class 22
Interface 6

Languages

Rust100%

Modules by API surface

src/notify.rs21 symbols
src/spawn.rs20 symbols
src/loop.rs9 symbols
examples/no-std/src/main.rs9 symbols
examples/pool.rs8 symbols
examples/counter.rs5 symbols
examples/tasks.rs4 symbols
examples/slices.rs4 symbols
examples/spawn.rs2 symbols
tests/spawn.rs1 symbols
examples/timer.rs1 symbols
examples/resume.rs1 symbols

For agents

$ claude mcp add pasts \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page