Skip to content

Cargo.toml requirements unclear to run examples #141

@ananswam

Description

@ananswam

I'm fairly new to Rust, so feel free to call me a noob and close this. I was trying to get the server example to run. I was able to do so easily by cloning and running cargo run --example server 127.0.0.1:12345 as suggested.

However, when I started to incorporate that file content into my own project, I got all kinds of weird errors until I combed through the Cargo.toml file for tokio-tungstenite and added the following to my own Cargo.toml.

[dependencies]
tokio-tungstenite = "*"

futures-util = { version = "0.3", default-features = false, features = ["async-await", "sink", "std"] }
pin-project = "1.0"
futures-channel = "0.3"
tokio = { version = "0.3", default-features = false, features = ["io-std", "macros", "rt-multi-thread", "stream", "time"] }

[dependencies.tungstenite]
version = "0.11.1"
default-features = false

Initially, I tried just adding futures-util and futures-channel and tokio with the latest versions and default features based on what the IDE did not recognize, and I got compile errors. I think it must have been due to version incompatibility or feature selection.

In any case, I am all up and running now and excited to use the code, but it might be helpful to have the full above Cargo.toml snippet included with the example.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions