I am quite new to rust so I might be doing something fundamentally wrong.
I tried compiling with --features "tls" and get the message:
error[E0599]: no method named `tls` found for type `warp::Server<warp::filter::map::Map<impl warp::Filter+std::marker::Copy, [closure@src/main.rs:11:34: 11:52]>>` in the current scope
--> src/main.rs:14:10
|
14 | .tls("examples/tls/cert.pem", "examples/tls/key.rsa")
|
This is with a 0.1.15 version from crates.io.
It looks like you've copied the example to your own crate (since I see the file is called main). In that case, you don't need to pass --features in the command, but rather specify them for a dependency. See the guide for more: https://doc.rust-lang.org/stable/cargo/reference/specifying-dependencies.html#choosing-features
Specifically, adding this to your Cargo.toml:
[dependencies]
warp = { version = "0.1.15", features = ["tls"] }
Finally got it working! Thank you, Sean!
Most helpful comment
Specifically, adding this to your
Cargo.toml: