#promise #stateless #core


Asynchronous operations for Bevy Engine

7 releases (4 breaking)

0.5.0 Nov 21, 2023
0.4.0 Jul 25, 2023
0.3.0 Mar 21, 2023
0.2.3 Mar 13, 2023
0.1.0 Feb 11, 2023
Download history 15/week @ 2023-10-30 10/week @ 2023-11-06 13/week @ 2023-11-13 56/week @ 2023-11-20 26/week @ 2023-11-27 24/week @ 2023-12-04 16/week @ 2023-12-11 21/week @ 2023-12-18 53/week @ 2023-12-25 44/week @ 2024-01-01 41/week @ 2024-01-08 22/week @ 2024-01-15 13/week @ 2024-01-22 23/week @ 2024-01-29 14/week @ 2024-02-05 51/week @ 2024-02-12

101 downloads per month
Used in 2 crates



crates.io MIT/Apache 2.0 Bevy tracking docs.rs


pecs is a plugin for Bevy that allows you to execute code asynchronously by chaining multiple promises as part of Bevy's ecs environment.

pecs stands for Promise Entity Component System.



bevy pecs
0.12 0.5
0.11 0.4
0.10 0.3
0.9 0.2


  • Promise chaining with then()/then_repeat()
  • State passing (state for promises is like self for items).
  • Complete type inference (the next promise knows the type of the previous result).
  • Out-of-the-box timer, UI and HTTP promises via stateless asyn mod and stateful state.asyn() method.
  • Custom promise registration (add any asynchronous function you want!).
  • System parameters fetching (promise asyn! functions accept the same parameters as Bevy systems do).
  • Nested promises (with chaining, obviously).
  • Combining promises with any/all for tuple/vec of promises via stateless Promise::any() /Promise::all() methods or stateful state.any()/state.all() methods.
  • State mapping via with(value)/map(func) (changes state type/value over chain calls).
  • Result mapping via with_result(value)/map_result(func) (changes result type/value over chain calls).


There is the output of the above example, pay some attention to time stamps:

18.667 INFO bevy_render::renderer: AdapterInfo { ... }
18.835 INFO simple: Wait a second..
19.842 INFO simple: How large is is the Bevy main web page?
19.924 INFO simple: It is 17759 bytes!
19.924 INFO simple: It tooks 1.09s to do this job.
19.924 INFO simple: Exiting now

Work in Progress

This crate is pretty young. API could and will change. The app may crash. Some promises could silently drop. Documentation is incomplete.

But. But. Examples work like a charm. And this fact gives us a lot of hope.


The pecs is dual-licensed under either:

This means you can select the license you prefer! This dual-licensing approach is the de-facto standard in the Rust ecosystem and there are very good reasons to include both.


Core Promise functionality.


~416K SLoC