Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Compilation Errors, Add Stable Rust Support, Improve Compatibility, and Implement Futures::io Traits #4

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
29 changes: 17 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "reqwest-file"
version = "0.2.1"
version = "0.3.0"
edition = "2021"
license = "MIT OR Apache-2.0"
authors = ["Alexander van Ratingen"]
Expand All @@ -12,16 +12,21 @@ readme = "README.md"
keywords = ["http", "request", "async"]

[dependencies]
bytes = "1.1.0"
pin-project = "1.0.10"
futures-util = "0.3.21"
tokio = { version = "1.16.1", default-features = false }
tokio-util = { version = "0.7.0", default-features = false, features = ["io"] }
reqwest = { version = "0.11.9", default-features = false, features = ["stream"] }
bytes = "1.7"
pin-project = "1.1"
futures-util = "0.3"
tokio = { version = "1.39", default-features = false, optional = true }
tokio-util = { version = "0.7", default-features = false, features = ["io", "io-util"], optional = true }
reqwest = { version = "0.12", default-features = false, features = ["stream"] }

[features]
nightly = []
tokio_io = ["dep:tokio", "dep:tokio-util"]
futures_io = ["futures-util/io"]

[dev-dependencies]
paste = "1.0.6"
serde = { version = "1.0.136", default-features = false, features = ["derive"] }
tokio = { version = "1.16.1", features = ["rt", "macros"] }
tokio-test = "0.4.2"
axum = { version = "0.5.16", default-features = false, features = ["headers", "query"] }
paste = "1.0"
serde = { version = "1.0", default-features = false, features = ["derive"] }
tokio = { version = "1.39", features = ["rt", "macros"] }
tokio-test = "0.4"
axum = { version = "0.5", default-features = false, features = ["http1", "headers", "query"] }
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Use web resources like regular async files.

* No unsafe code (`#[forbid(unsafe_code)]`)
* Tested; code coverage: 100%
* Supports either `futures_util::io::{AsyncRead, AsyncSeek}` or `tokio::io::{AsyncRead, AsyncSeek}` (via feature flags)

## Example

Expand Down
7 changes: 7 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fn main() {
#[cfg(all(feature = "tokio_io", feature = "futures_io"))]
compile_error!("feature \"tokio_io\" and feature \"futures_io\" cannot be enabled at the same time");

#[cfg(not(any(feature = "tokio_io", feature = "futures_io")))]
compile_error!("either feature \"tokio_io\" or feature \"futures_io\" needs to be enabled");
}
Loading