Cargo tests and formatting security audit

reqwest streams for Rust

Library provides HTTP response streaming support for reqwest: - JSON array stream format - JSON lines stream format - CSV stream - Protobuf len-prefixed stream format

This type of responses are useful when you are reading huge stream of objects from some source (such as database, file, etc) and want to avoid huge memory allocations to store on the server side.

Quick start

Cargo.toml: toml [dependencies] reqwest-streams = { version = "0.1", features=["json", "csv", "protobuf"] }

Example code: ```rust

use reqweststreams::*; use futuresutil::stream::BoxStream; use serde::{Deserialize, Serialize};

[derive(Debug, Clone, Deserialize)]

struct MyTestStructure { sometestfield: String }

[tokio::main]

async fn main() -> Result<(), Box> {

let _stream = reqwest::get("http://localhost:8080/json-array")
    .await?
    .json_array_stream::<MyTestStructure>(1024);

Ok(())

} ```

All examples available in examples directory.

To run example use: ```

cargo run --example json-stream

```

Need server support?

There are the same functionality: - axum-streams.

Licence

Apache Software License (ASL)

Author

Abdulla Abdurakhmanov