-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cargo.toml
106 lines (90 loc) · 4.06 KB
/
Cargo.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
[package]
name = "reqwest-cross"
version = "0.5.0"
authors = ["One <one.bgz1@gmail.com>"]
categories = ["web-programming::http-client", "wasm"]
documentation = "https://docs.rs/reqwest-cross"
edition = "2021"
keywords = ["http", "wasm", "native", "web", "request"]
license = "MIT OR Apache-2.0"
readme = "README.md"
repository = "https://github.com/c-git/reqwest-cross"
description = "Wrapper around reqwest for use in both native and wasm"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[package.metadata.docs.rs]
all-features = true
[dependencies]
anyhow = "1.0.95"
document-features = "0.2.10"
egui = { version = "0.30.0", default-features = false, optional = true }
futures = "0.3.28"
reqwest = { version = "0.12.12", default-features = false }
thiserror = "2.0.9"
tracing = "0.1.41"
# For native compilation
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tokio = { version = "1", default-features = false, optional = true }
# For compiling to wasm:
[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen-futures = "0.4.34"
js-sys = { version = "0.3.69", optional = true }
web-sys = { version = "0.3.69", optional = true }
[dev-dependencies]
wasm-bindgen-test = "0.3.34"
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
tokio = { version = "1.27.0", default-features = false, features = ["macros", "rt-multi-thread"] }
[[example]]
name = "loop_yield_custom"
required-features = ["yield_now"]
[[example]]
name = "loop_yield_data_state"
required-features = ["yield_now"]
[features]
## Enables the tokio runtime and reqwest's default features.
## If default-features gets disabled do ensure you at least enable tls, unless you explicitly do not want tls support.
default = ["native-tokio", "reqwest_default"]
## Enables reqwest's default features
reqwest_default = ["reqwest/default"]
## Sets [tokio][tokio-url] as the runtime to use for native
native-tokio = ["dep:tokio"]
## Add a function that can be called to yield to the executor.
## This is only needed if you only have one thread and need to release it to prevent a deadlock
## because you are waiting on another future (as can be the case in WASM). If you are using a
## framework such as egui this may not be necessary as they already allow for other futures to
## make progress. But one test will quickly let you know either way. If the program freezes
## after you make a request then this can help.
yield_now = ["dep:js-sys", "dep:web-sys"]
## Add helper functions to ['DataState'] to do egui boiler plate
egui = ["dep:egui"]
#! The following enable a subset of reqwest's features.
#! If you need a feature that we didn't include please open an issue and let us know and we'll add it.
#! In the mean while you can depend on reqwest directly with the same version as this crate and enable the feature.
#! Because features are additive it will be enabled but note that if the version goes out of sync it will cause compilation issues.
## Enables the feature with the same name on reqwest
default-tls = ["reqwest/default-tls"]
## Enables the feature with the same name on reqwest
native-tls = ["reqwest/native-tls"]
## Enables the feature with the same name on reqwest
rustls-tls = ["reqwest/rustls-tls"]
## Enables the feature with the same name on reqwest
http2 = ["reqwest/http2"]
## Enables the feature with the same name on reqwest
json = ["reqwest/json"]
## Enables the feature with the same name on reqwest
cookies = ["reqwest/cookies"]
## Enables the feature with the same name on reqwest
hickory-dns = ["reqwest/hickory-dns"]
## Enables the feature with the same name on reqwest
multipart = ["reqwest/multipart"]
## Enables the feature with the same name on reqwest
socks = ["reqwest/socks"]
## Enables the feature with the same name on reqwest
stream = ["reqwest/stream"]
## Enables the feature with the same name on reqwest
brotli = ["reqwest/brotli"]
## Enables the feature with the same name on reqwest
deflate = ["reqwest/deflate"]
## Enables the feature with the same name on reqwest
gzip = ["reqwest/gzip"]
## Enables the feature with the same name on reqwest
zstd = ["reqwest/zstd"]