363 lines
10 KiB
TOML
363 lines
10 KiB
TOML
[package]
|
|
name = "hyper"
|
|
version = "1.11.0"
|
|
description = "A protective and efficient HTTP library for all."
|
|
readme = "README.md"
|
|
homepage = "https://hyper.rs"
|
|
documentation = "https://docs.rs/hyper"
|
|
repository = "https://github.com/hyperium/hyper"
|
|
license = "MIT"
|
|
authors = ["Sean McArthur <sean@seanmonstar.com>"]
|
|
keywords = ["http", "hyper", "hyperium"]
|
|
categories = ["network-programming", "web-programming::http-client", "web-programming::http-server"]
|
|
edition = "2021"
|
|
rust-version = "1.63" # keep in sync with MSRV.md dev doc
|
|
|
|
include = [
|
|
"Cargo.toml",
|
|
"LICENSE",
|
|
"src/**/*",
|
|
]
|
|
|
|
[dependencies]
|
|
bytes = "1.2"
|
|
http = "1"
|
|
http-body = "1"
|
|
tokio = { version = "1", features = ["sync"] }
|
|
|
|
# Optional
|
|
|
|
atomic-waker = { version = "1.1.2", optional = true }
|
|
futures-channel = { version = "0.3", optional = true }
|
|
futures-core = { version = "0.3.31", optional = true }
|
|
futures-util = { version = "0.3", default-features = false, features = ["alloc"], optional = true }
|
|
h2 = { version = "0.4.14", optional = true }
|
|
http-body-util = { version = "0.1", optional = true }
|
|
httparse = { version = "1.9", optional = true }
|
|
httpdate = { version = "1.0", optional = true }
|
|
itoa = { version = "1", optional = true }
|
|
pin-project-lite = { version = "0.2.4", optional = true }
|
|
smallvec = { version = "1.12", features = ["const_generics", "const_new"], optional = true }
|
|
tracing = { version = "0.1", default-features = false, features = ["std"], optional = true }
|
|
want = { version = "0.3", optional = true }
|
|
|
|
[dev-dependencies]
|
|
form_urlencoded = "1"
|
|
futures-channel = { version = "0.3", features = ["sink"] }
|
|
futures-util = { version = "0.3", default-features = false, features = ["alloc", "sink"] }
|
|
http-body-util = "0.1"
|
|
pretty_env_logger = "0.5"
|
|
pin-project-lite = "0.2.4"
|
|
spmc = "0.3"
|
|
serde = { version = "1.0", features = ["derive"] }
|
|
serde_json = "1.0"
|
|
tracing = "0.1"
|
|
tracing-subscriber = "0.3"
|
|
tokio = { version = "1", features = [
|
|
"fs",
|
|
"macros",
|
|
"net",
|
|
"io-std",
|
|
"io-util",
|
|
"rt",
|
|
"rt-multi-thread",
|
|
"sync",
|
|
"time",
|
|
"test-util",
|
|
] }
|
|
tokio-test = "0.4"
|
|
tokio-util = "0.7.10"
|
|
|
|
[features]
|
|
# Nothing by default
|
|
default = []
|
|
|
|
# Easily turn it all on
|
|
full = [
|
|
"client",
|
|
"http1",
|
|
"http2",
|
|
"server",
|
|
]
|
|
|
|
# HTTP versions
|
|
http1 = ["dep:atomic-waker", "dep:futures-channel", "dep:futures-core", "dep:httparse", "dep:itoa"]
|
|
http2 = ["dep:atomic-waker", "dep:futures-channel", "dep:futures-core", "dep:h2"]
|
|
|
|
# Client/Server
|
|
client = ["dep:want", "dep:pin-project-lite", "dep:smallvec"]
|
|
server = ["dep:httpdate", "dep:pin-project-lite", "dep:smallvec"]
|
|
|
|
# C-API support (currently unstable (no semver))
|
|
ffi = ["dep:http-body-util", "dep:futures-util"]
|
|
capi = []
|
|
|
|
# Utilize tracing (currently unstable)
|
|
tracing = ["dep:tracing"]
|
|
|
|
# internal features used in CI
|
|
nightly = []
|
|
|
|
[lints.rust.unexpected_cfgs]
|
|
level = "warn"
|
|
check-cfg = [
|
|
'cfg(hyper_unstable_tracing)',
|
|
'cfg(hyper_unstable_ffi)'
|
|
]
|
|
|
|
[lints.clippy]
|
|
pedantic = { level = "warn", priority = -1 }
|
|
restriction = { level = "warn", priority = -2 }
|
|
|
|
# keep an allow list of lints
|
|
|
|
# lints to decide on
|
|
|
|
arithmetic_side_effects = "allow" # TODO: consider
|
|
as_conversions = "allow" # TODO: tricky
|
|
cast_possible_truncation = "allow" # TODO: consider
|
|
cast_precision_loss = "allow" # TODO: consider
|
|
checked_conversions = "allow"
|
|
collapsible_match = "allow"
|
|
else_if_without_else = "allow"
|
|
enum_glob_use = "allow"
|
|
float_arithmetic = "allow"
|
|
ignored_unit_patterns = "allow"
|
|
indexing_slicing = "allow"
|
|
integer_division = "allow"
|
|
integer_division_remainder_used = "allow"
|
|
let_unit_value = "allow"
|
|
map_err_ignore = "allow"
|
|
map_unwrap_or = "allow"
|
|
match_wild_err_arm = "allow"
|
|
missing_fields_in_debug = "allow" # TODO: use finish_non_exhaustive
|
|
missing_errors_doc = "allow" # TODO: good to fix
|
|
missing_panics_doc = "allow" # TODO: might be false
|
|
multiple_inherent_impl = "allow"
|
|
multiple_unsafe_ops_per_block = "allow"
|
|
needless_continue = "allow"
|
|
needless_pass_by_value = "allow"
|
|
panic = "allow"
|
|
pattern_type_mismatch = "allow"
|
|
redundant_closure_for_method_calls = "allow"
|
|
redundant_else = "allow"
|
|
ref_patterns = "allow" # TODO: perhaps deny?
|
|
single_char_lifetime_names = "allow"
|
|
struct_excessive_bools = "allow" # TODO: bogus lint?
|
|
trivially_copy_pass_by_ref = "allow"
|
|
unnecessary_trailing_comma = "allow"
|
|
unnested_or_patterns = "allow"
|
|
unused_async = "allow" # TODO: is it for API?
|
|
unused_trait_names = "allow" # TODO: kinda annoying, but might be good to deny
|
|
unwrap_in_result = "allow"
|
|
useless_borrows_in_formatting = "allow"
|
|
wildcard_enum_match_arm = "allow"
|
|
|
|
# explicitly allowed
|
|
absolute_paths = "allow" # sometimes its cleaner
|
|
arbitrary_source_item_ordering = "allow" # order: std, deps, crate
|
|
blanket_clippy_restriction_lints = "allow" # allowlist is better
|
|
clone_on_ref_ptr = "allow" # Arc::clone(blah) is needlessly noisy
|
|
cognitive_complexity = "allow" # is this ever useful?
|
|
decimal_literal_representation = "allow" # arguably more human-readable
|
|
default_numeric_fallback = "allow" # too many false positives
|
|
expect_used = "allow" # expect is self-documenting
|
|
error_impl_error = "allow" # mod::Error is a fine name
|
|
field_scoped_visibility_modifiers = "allow" # possibly good idea, noisy for now
|
|
if_not_else = "allow" # order depends on which is more common, not truthiness
|
|
if_then_some_else_none = "allow" # control flow as if better than closures
|
|
items_after_statements = "allow" # these can be useful
|
|
implicit_return = "allow" # standard rust
|
|
impl_trait_in_params = "allow" # turbofish ignored on purpose
|
|
inline_modules = "allow" # common for sealed types
|
|
inline_trait_bounds = "allow" # more concise if shorter bounds
|
|
let_underscore_must_use = "allow" # the entire point was to ignore must_use
|
|
let_underscore_untyped = "allow"
|
|
mod_module_files = "allow" # easier to find than self-named modules
|
|
module_inception = "allow" # sometimes that happens
|
|
min_ident_chars = "allow" # not to be abused, nor forced
|
|
missing_assert_message = "allow" # not much value
|
|
missing_docs_in_private_items = "allow" # these docs aren't rendered
|
|
missing_inline_in_public_items = "allow" # bad lint
|
|
missing_trait_methods = "allow"
|
|
must_use_candidate = "allow" # bad lint
|
|
module_name_repetitions = "allow" # sometimes it happens, not bad at all
|
|
new_without_default = "allow" # not everything needs a Default impl
|
|
panic_in_result_fn = "allow" # panics are for invariants
|
|
pub_use = "allow"
|
|
pub_with_shorthand = "allow"
|
|
question_mark_used = "allow" # question mark is excellent
|
|
unreachable = "allow" # self-documenting invariants
|
|
renamed_function_params = "allow" # we can pick clearer names
|
|
same_name_method = "allow"
|
|
shadow_reuse = "allow" # shadowing is useful
|
|
shadow_same = "allow" # shadowing is useful
|
|
shadow_unrelated = "allow" # shadowing is useful
|
|
single_call_fn = "allow" # abstracting to a function is the point
|
|
self_named_module_files = "deny" # already denied but, rly, dont do it
|
|
semicolon_inside_block ="allow" # depends on context
|
|
semicolon_outside_block ="allow" # depends on context
|
|
std_instead_of_alloc = "allow" # std is more idiomatic
|
|
std_instead_of_core = "allow" # std is more idiomatic
|
|
struct_field_names = "allow" # not really helpful
|
|
too_many_lines = "allow" # reconsider someday?
|
|
type_complexity = "allow" # not helpful
|
|
used_underscore_items = "allow"
|
|
unnecessary_safety_comment = "allow" # more safety comments are a good thing
|
|
unseparated_literal_suffix = "allow" # i don't like 0_u8 (do i?)
|
|
|
|
[package.metadata.docs.rs]
|
|
features = ["ffi", "full", "tracing"]
|
|
rustdoc-args = ["--cfg", "hyper_unstable_ffi", "--cfg", "hyper_unstable_tracing"]
|
|
|
|
[package.metadata.playground]
|
|
features = ["full"]
|
|
|
|
[package.metadata.capi.header]
|
|
generation = false
|
|
subdirectory = false
|
|
|
|
[package.metadata.capi.install.include]
|
|
asset = [{ from="capi/include/hyper.h" }]
|
|
|
|
[profile.release]
|
|
codegen-units = 1
|
|
incremental = false
|
|
|
|
[profile.bench]
|
|
codegen-units = 1
|
|
incremental = false
|
|
|
|
[[example]]
|
|
name = "client"
|
|
path = "examples/client.rs"
|
|
required-features = ["full"]
|
|
|
|
[[example]]
|
|
name = "client_json"
|
|
path = "examples/client_json.rs"
|
|
required-features = ["full"]
|
|
|
|
[[example]]
|
|
name = "echo"
|
|
path = "examples/echo.rs"
|
|
required-features = ["full"]
|
|
|
|
[[example]]
|
|
name = "gateway"
|
|
path = "examples/gateway.rs"
|
|
required-features = ["full"]
|
|
|
|
[[example]]
|
|
name = "graceful_shutdown"
|
|
path = "examples/graceful_shutdown.rs"
|
|
required-features = ["full"]
|
|
|
|
[[example]]
|
|
name = "hello"
|
|
path = "examples/hello.rs"
|
|
required-features = ["full"]
|
|
|
|
[[example]]
|
|
name = "http_proxy"
|
|
path = "examples/http_proxy.rs"
|
|
required-features = ["full"]
|
|
|
|
[[example]]
|
|
name = "multi_server"
|
|
path = "examples/multi_server.rs"
|
|
required-features = ["full"]
|
|
|
|
[[example]]
|
|
name = "params"
|
|
path = "examples/params.rs"
|
|
required-features = ["full"]
|
|
|
|
[[example]]
|
|
name = "send_file"
|
|
path = "examples/send_file.rs"
|
|
required-features = ["full"]
|
|
|
|
[[example]]
|
|
name = "service_struct_impl"
|
|
path = "examples/service_struct_impl.rs"
|
|
required-features = ["full"]
|
|
|
|
[[example]]
|
|
name = "single_threaded"
|
|
path = "examples/single_threaded.rs"
|
|
required-features = ["full"]
|
|
|
|
[[example]]
|
|
name = "state"
|
|
path = "examples/state.rs"
|
|
required-features = ["full"]
|
|
|
|
[[example]]
|
|
name = "upgrades"
|
|
path = "examples/upgrades.rs"
|
|
required-features = ["full"]
|
|
|
|
|
|
[[example]]
|
|
name = "web_api"
|
|
path = "examples/web_api.rs"
|
|
required-features = ["full"]
|
|
|
|
|
|
[[bench]]
|
|
name = "body"
|
|
path = "benches/body.rs"
|
|
required-features = ["full"]
|
|
|
|
[[bench]]
|
|
name = "connect"
|
|
path = "benches/connect.rs"
|
|
required-features = ["full"]
|
|
|
|
[[bench]]
|
|
name = "end_to_end"
|
|
path = "benches/end_to_end.rs"
|
|
required-features = ["full"]
|
|
|
|
[[bench]]
|
|
name = "pipeline"
|
|
path = "benches/pipeline.rs"
|
|
required-features = ["full"]
|
|
|
|
[[bench]]
|
|
name = "server"
|
|
path = "benches/server.rs"
|
|
required-features = ["full"]
|
|
|
|
|
|
[[test]]
|
|
name = "client"
|
|
path = "tests/client.rs"
|
|
required-features = ["full"]
|
|
|
|
[[test]]
|
|
name = "integration"
|
|
path = "tests/integration.rs"
|
|
required-features = ["full"]
|
|
|
|
[[test]]
|
|
name = "ready_on_poll_stream"
|
|
path = "tests/ready_on_poll_stream.rs"
|
|
required-features = ["full"]
|
|
|
|
[[test]]
|
|
name = "unbuffered_stream"
|
|
path = "tests/unbuffered_stream.rs"
|
|
required-features = ["full"]
|
|
|
|
[[test]]
|
|
name = "server"
|
|
path = "tests/server.rs"
|
|
required-features = ["full"]
|
|
|
|
[[test]]
|
|
name = "h1_shutdown_while_buffered"
|
|
path = "tests/h1_shutdown_while_buffered.rs"
|
|
required-features = ["full"]
|