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

#1235 in Asynchronous

Download history 1/week @ 2023-12-31 48/week @ 2024-01-07 50/week @ 2024-01-14 29/week @ 2024-01-21 14/week @ 2024-01-28 6/week @ 2024-02-04 15/week @ 2024-02-11 26/week @ 2024-02-18 52/week @ 2024-02-25 23/week @ 2024-03-03 23/week @ 2024-03-10 29/week @ 2024-03-17 3/week @ 2024-03-24 70/week @ 2024-03-31 66/week @ 2024-04-07 71/week @ 2024-04-14

216 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.7–2.4MB
~47K SLoC