4 releases

0.1.3 Oct 18, 2023
0.1.2 Sep 9, 2023
0.1.1 Aug 31, 2023
0.1.0 Aug 30, 2023

#1953 in Asynchronous

Download history 23/week @ 2024-07-13 24/week @ 2024-07-20 23/week @ 2024-07-27 29/week @ 2024-08-03 43/week @ 2024-08-10 30/week @ 2024-08-17 30/week @ 2024-08-24 56/week @ 2024-08-31 82/week @ 2024-09-07 91/week @ 2024-09-14 96/week @ 2024-09-21 55/week @ 2024-09-28 21/week @ 2024-10-05 27/week @ 2024-10-12 34/week @ 2024-10-19 42/week @ 2024-10-26

131 downloads per month
Used in 4 crates (via geng-async-state)

MIT license

13KB
54 lines

switch-resume

This crates provides functionality for running switchable tasks (futures).

Switching is a control flow mechanism that pauses normal execution of current task, captures current continuation and passes it as an argument to the provided async fn. The task then proceeds by evaluating that fn, instead of resuming normally.

In order to resume normal execution, the passed resumption object can be called explicitly.

This is an implementation of delimited continuations in Rust using async that works on stable.


lib.rs:

Examples

Dependencies

~1.6–2.4MB
~45K SLoC