#async-stream #no-std #stream

no-std asynk-strim

Lightweight stream generator library

3 releases

0.1.5 Dec 26, 2025
0.1.4 Nov 19, 2025
0.1.3 Oct 29, 2025
0.1.2 Oct 9, 2024

#71 in Asynchronous

Download history 143044/week @ 2026-02-21 156140/week @ 2026-02-28 185942/week @ 2026-03-07 192029/week @ 2026-03-14 197771/week @ 2026-03-21 159762/week @ 2026-03-28 150017/week @ 2026-04-04 184184/week @ 2026-04-11 184605/week @ 2026-04-18 201334/week @ 2026-04-25 189903/week @ 2026-05-02 217517/week @ 2026-05-09 220658/week @ 2026-05-16 227128/week @ 2026-05-23 255938/week @ 2026-05-30 229419/week @ 2026-06-06

968,266 downloads per month
Used in 329 crates (7 directly)

MIT/Apache

19KB
319 lines

asynk-strim

Like async-stream but without macros. Like async-fn-stream but a little more efficient.

Features:

  • macroless API
  • one dependency (besides futures-core which I don't count since it provides the Stream definition)
  • no_std-compatible, zero allocations

⚠ Important

This crate adds a wrapper around the wakers that contains data and pointers needed to yield items. Crates like embassy use a similar approach and will therefore clash with us.

If you run into this issue (which will manifest as a runtime panic), you can use the unwrap_waker function. This function will wrap a future and remove the waker wrapper.

While you can't use the yielder inside the unwrapped future, stuff like embassy should work again.

Example

use futures_lite::stream;
use std::pin::pin;

let stream = pin!(asynk_strim::stream_fn(|mut yielder| async move {
    yielder.yield_item("hello world!").await;
    yielder.yield_item("pretty neato, ain't it?").await;
}));

let mut stream = stream::block_on(stream);
assert_eq!(stream.next(), Some("hello world!"));
assert_eq!(stream.next(), Some("pretty neato, ain't it?"));
assert_eq!(stream.next(), None);

Comparisons

async-stream

In comparison to async-stream we offer the following advantages:

  • no macros
  • slightly faster performance
  • no_std support

async-fn-stream

In comparison to async-stream we offer the following advantages:

  • no allocations
  • slightly faster performance
  • no_std support

Acknowledgements

This crate combines approaches from the following crates:

License

Licensed under tither the MIT or Apache 2.0 license (at your choosing)

Dependencies

~64KB