futures-async-stream

Async stream for Rust and the futures crate.

APACHE-2.0 License

Downloads
1.1M
Stars
174
Committers
3

Bot releases are visible (Hide)

futures-async-stream - 0.1.0-alpha.6

Published by taiki-e about 5 years ago

  • Added async_try_stream to support ? operator in async stream. e.g. You can write the following:

    #![feature(generators)]
    use futures::stream::Stream;
    use futures_async_stream::async_try_stream;
    
    #[async_try_stream(ok = i32, error = Box<dyn std::error::Error + Send + Sync>)]
    async fn foo(stream: impl Stream<Item = String>) {
        #[for_await]
        for x in stream {
            yield x.parse()?;
        }
    }
    
  • Updated pin-project to 0.4.0-alpha.9.

futures-async-stream - 0.1.0-alpha.5

Published by taiki-e about 5 years ago

  • Pined the version of pin-project dependency
futures-async-stream - 0.1.0-alpha.4

Published by taiki-e about 5 years ago

  • Removed usage of some feature gates.

  • Updated pin-project to 0.4.0-alpha.4.

futures-async-stream - 0.1.0-alpha.3

Published by taiki-e about 5 years ago

  • Updated proc-macro2, syn, and quote to 1.0.
futures-async-stream - 0.1.0-alpha.2

Published by taiki-e about 5 years ago

  • You can now use async stream functions in traits. e.g. You can write the following:

    #![feature(async_await, generators)]
    use futures_async_stream::async_stream;
    
    trait Foo {
        #[async_stream(boxed, item = u32)]
        async fn method(&mut self);
    }
    
    struct Bar(u32);
    
    impl Foo for Bar {
        #[async_stream(boxed, item = u32)]
        async fn method(&mut self) {
            while self.0 < u32::max_value() {
                self.0 += 1;
                yield self.0;
            }
        }
    }
    
futures-async-stream - 0.1.0-alpha.1

Published by taiki-e about 5 years ago

Initial release

Package Rankings
Top 8.8% on Crates.io
Badges
Extracted from project README
crates.io docs.rs license github actions