-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathCargo.toml
More file actions
152 lines (124 loc) · 4.23 KB
/
Cargo.toml
File metadata and controls
152 lines (124 loc) · 4.23 KB
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
[package]
name = "oneio"
version = "0.21.0"
authors = ["Mingwei Zhang <mingwei@bgpkit.com>"]
edition = "2021"
readme = "README.md"
license = "MIT"
repository = "https://github.com/bgpkit/oneio"
documentation = "https://docs.rs/oneio"
description = """
OneIO is a Rust library that provides unified simple IO interface for
reading and writing to and from data files from different sources and compressions.
"""
default-run = "oneio"
keywords = ["io", "util", "s3", "ftp"]
[[bin]]
name = "oneio"
path = "src/bin/oneio.rs"
required-features = ["cli"]
[dependencies]
# required dependency
dotenvy = "0.15"
thiserror = "2.0"
# feature: remote
reqwest = { version = "0.12", default-features = false, features = ["blocking", "http2", "charset", "stream"], optional = true }
suppaftp = { version = "7.0", optional = true }
# feature: compressions
# Turn off flate2 default-features so we can explicitly choose backend via features
flate2 = { version = "1.1", optional = true, default-features = false }
bzip2 = { version = "0.6.0", optional = true }
lz4 = { version = "1.24", optional = true }
xz2 = { version = "0.1", optional = true }
zstd = { version = "0.13.2", optional = true }
# feature: digest
ring = { version = "0.17", optional = true }
hex = { version = "0.4", optional = true }
# feature: json
serde = { version = "1.0", optional = true }
serde_json = { version = "1.0", optional = true }
# feature: s3
rust-s3 = { version = "0.37", optional = true, default-features = false, features = [
"sync-rustls-tls",
] }
# feature: cli
clap = { version = "4.4", features = ["derive"], optional = true }
tracing = { version = "0.1", optional = true }
indicatif = { version = "0.18", optional = true }
# feature: async (Phase 3)
tokio = { version = "1.0", features = ["rt", "rt-multi-thread", "io-util", "fs"], optional = true }
async-compression = { version = "0.4", features = ["tokio", "gzip", "bzip2", "zstd"], optional = true }
futures = { version = "0.3", optional = true }
rustls_sys = { package = "rustls", version = "0.23", optional = true }
tokio-util = { version = "0.7", optional = true }
[features]
# Simple, flat feature structure
default = ["gz", "bz", "https"]
# Backward compatible `lib-core` feature, no longer default.
lib-core = ["http", "ftp", "gz", "bz", "lz", "xz", "zstd", "json"]
# Transport features (TLS handled automatically by libraries)
http = ["reqwest"]
https = ["http", "rustls"] # https needs http
ftp = ["https", "suppaftp"] # ftp needs https
s3 = ["rust-s3"]
gz = ["gz-zlib-rs"]
# internal feature to enable gzip support
any_gz = []
gz-miniz = ["any_gz", "flate2/rust_backend"]
gz-zlib-rs = ["any_gz", "flate2/zlib-rs"]
gz-zlib-ng = ["any_gz", "flate2/zlib-ng"]
gz-zlib-cloudflare = ["any_gz", "flate2/cloudflare_zlib"]
bz = ["bzip2"]
lz = ["lz4"]
xz = ["xz2"]
zstd = ["dep:zstd"]
# Other features
json = ["serde", "serde_json"]
digest = ["ring", "hex"]
# CLI tool (includes common features)
cli = ["clap", "tracing", "indicatif", "gz", "bz", "lz", "xz", "http", "s3", "digest"]
# Advanced: TLS selection (only if explicitly needed)
native-tls = [
"reqwest?/native-tls",
"suppaftp?/native-tls",
"rust-s3?/sync-native-tls",
]
rustls = [
"dep:rustls_sys",
"reqwest?/rustls-tls-native-roots",
"reqwest?/rustls-tls-webpki-roots",
"suppaftp?/rustls",
"rust-s3?/sync-rustls-tls"
]
# Future: Async support
async = ["tokio", "tokio-util", "async-compression", "futures"]
[dev-dependencies]
serde = { version = "1.0", features = ["derive"] }
tracing = "0.1"
tracing-subscriber = "0.3"
tar = "0.4"
tokio = { version = "1.0", features = ["macros", "rt"] }
indicatif = "0.18"
criterion = { version = "0.5", default-features = false }
# Benchmarks
[[bench]]
name = "gzip_decompress"
harness = false
required-features = ["any_gz"]
[[bench]]
name = "bzip2_decompress"
harness = false
required-features = ["bz"]
# This list only includes examples which require additional features to run. These are more in the examples' directory.
[[example]]
name = "s3_operations"
required-features = ["s3"]
[[example]]
name = "async_read"
required-features = ["async"]
[[example]]
name = "test_crypto_provider"
required-features = ["https"]
[package.metadata.binstall]
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }.tar.gz"
pkg-fmt = "tgz"