Closed locnnil closed 2 months ago
What version of hyperlocal
are you trying to build with - current main
?
Can you add some more context for reproducing this?
@iamjpotts Sure, added in the description.
Version 0.7
of hyperlocal
should be considered unsupported at this point. Version 0.8
- which is still using 0.14 versions of hyper
- is the latest published version.
If you want to use it with hyper 1.x
(e.g. hyper 1.3
), you'll need to setup your Cargo.toml
to point at this repository for its hyperlocal
dependency instead of using a version which would only be able to use versions published to crates.io.
@iamjpotts thanks for letting me know!
Now with the dependency on Cargo.toml
like this:
[dependencies]
http-body-util = "0.1.2"
hyper = { version = "1.3", features = ["client"] }
hyper-util = "0.1.6"
hyperlocal = {git = "https://github.com/softprops/hyperlocal", branch = "main"}
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tokio = { version = "1.35", features = ["full"] }
I'm having this error:
error[E0599]: no function or associated item named `unix` found for struct `Client` in the current scope
--> src/main.rs:157:62
|
157 | let client: Client<UnixConnector, Full<Bytes>> = Client::unix();
| ^^^^ function or associated item not found in `Client<_, _>`
Any idea on how to fix it? Thank you for your help, I appreciate it.
I cannot reproduce your error.
I:
cargo new foo
to create a new application crateCargo.toml
witih the below snippetsrc/main.rs
with the contents of examples/client.rsfoo/
ran both cargo b
and cargo b --release
Cargo.toml
:
[package]
name = "foo"
version = "0.1.0"
edition = "2021"
[dependencies]
http-body-util = "0.1.2"
hyper = { version = "1.3", features = ["client"] }
hyper-util = "0.1.6"
hyperlocal = {git = "https://github.com/softprops/hyperlocal", branch = "main"}
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tokio = { version = "1.35", features = ["full"] }
[profile.release]
panic = "abort"
strip = true
opt-level = "z"
lto = true
codegen-units = 1
$ rustc --version
rustc 1.78.0 (9b00956e5 2024-04-29)
Perhaps you could post a gist
or a new public repo that reproduces this failure?
@iamjpotts I just saw the error, I was adding mistakenly a new use that had a wrong path. Now the example compiles.
But basically, at this point, only by reference to the hyperlocal
pointing to the main branch of this repository make it work.
Glad to hear you figured it out!
Having to reference the repo's main branch rather than crates.io is expected when used with hyper 1.x
as the version of hyperlocal
supporting it is not published there yet.
Thank you very much! I think that this issue can be considered closed!
Client example isn't working:
Cargo.toml file:
rustup toolchain:
x86_64-unknown-linux-musl