#future #json #user-name

streamson-futures

A library which integrates streamson with futures stream

12 stable releases (3 major)

7.1.0 May 10, 2021
7.0.1 Apr 15, 2021
6.3.1 Dec 8, 2020
6.2.0 Nov 12, 2020
4.1.0 Aug 29, 2020

#1950 in Parser implementations

24 downloads per month

MIT license

240KB
5.5K SLoC

docs.rs

Streamson futures

A library which integrates streamson with futures. It enables to use streamson with async runs

Examples

Wrapping a stream

use bytes::Bytes;
use futures::stream::{self, StreamExt};
use streamson_lib::matcher;
use streamson_futures::stream::BufferStream;

let stream = stream::iter(
    vec![r#"{"users": ["#, r#"{"name": "carl", "id": 1}"#, r#"]}"#]
        .drain(..)
        .map(Bytes::from)
        .collect::<Vec<Bytes>>()
);
let matcher = matcher::Simple::new(r#"{"users"}[]{"name"}"#).unwrap();
let wrapped_stream = BufferStream::new(stream, Box::new(matcher));

lib.rs:

Library which integrates streamson-lib with futures

Dependencies

~1MB
~19K SLoC