Questions tagged [rust-cargo]

Cargo is the official package manager for the Rust programming language.

Cargo is the official package manager for the Rust programming language. Using a manifest, the programmer can provide metadata about a project, including dependencies, which Cargo can automatically download and compile before compiling the project itself.

You can find more information in the cargo book and browse the crates (Rust packages) in crates.io.

2044 questions
0
votes
0 answers

error: failed to select a version for `skia-bindings`. - cargo dependency conflict

I'm trying to build and flash a gui demo onto an esp32s3. cargo +esp build -p printerdemo_mcu --target xtensa-esp32s3-none-elf --no-default-features --features=mcu-board-support/esp32-s3-box --release --config…
user
  • 1
  • 1
0
votes
1 answer

How to generate a dry run log of crate test calls in Rust Cargo?

I am trying to expand on an existing crate. When I run the standard crate tests, some of them are failing. The crate creator has used macros and iterators extensively to create the tests. I'm unable to decode what the actual test being run are, so…
0
votes
0 answers

How to configure MongoDB options for collection's watch method in Rust to track insert operations?

In my chat-like application, I'm using the ChangeStream feature in my Rust-MongoDB code to retrieve new posts made by other users in a specific channel/group(chat of multiple users). I'm using websockets to send these new posts in real-time to…
0
votes
1 answer

adding local build of a transitive dependency to rust wasm app

I wanted to add some logging to a lib used both direcly in my app and also from another lib as transitive dependency. So i've cloned the repo, added logging and then added it as somelib = {path= "../../somelib"} to my Cargo. The build then failed…
user656449
  • 2,950
  • 2
  • 30
  • 43
0
votes
1 answer

Rust, How to configure a workspace of libraries?

I have a workspace lets call my_workspace. my_workspace has a series of small libraries related but each one with their own responsibility. Something like: [workspace] members = [ "my_lib_1", "my_lib_2", "my_lib_3", ... ] And…
al3x
  • 589
  • 1
  • 4
  • 16
0
votes
0 answers

Accessing Rust modules from other directories fails. What is the issue?

Let's assume we have the following file tree: src |--bin | |--hw.rs |--libs | |--streams.rs | |--structs.rs |--main.rs I want to access some structs from the structs module inside the hw file, however it doesn't compile, as it can't find…
AT3RM0N
  • 1
  • 2
0
votes
0 answers

How can I catch any event from a Tauri Rust app in main.rs to trigger a notification function?

I want to catch any event from TAURI rust app in main.rs to handle notification function. Story is: Just catch an event(it can be click, mouseEnter, DOMContentLoaded etc..) and trigger another function inside main.rs which is gonna be notification…
0
votes
0 answers

how to cascade feature in workspace

My rust project is constructed from a workspace with many (50+) sub-crates in the workspace. I want to cascade a feature flag (sharing the same name) through all the dependency tree (all the sub-crates which are depending on each other). example # I…
Avba
  • 14,822
  • 20
  • 92
  • 192
0
votes
1 answer

Building/running Cargo based examples

For certain examples, I want to build/run them using Cargo. My examples directory looks as follows: examples/ test1.rs test2/ Cargo.toml src/ main.rs ... Is this possible? If it is, what are my options to accomplish this? I tried a few…
rsergeant
  • 3
  • 1
0
votes
0 answers

Conditional builds for crates in workspace

nub here. Let's say I have the workspace bar-win-x86-x64_nightly v0.1.0 └── rand v0.8.5 ├── rand_chacha v0.3.1 │ ├── ppv-lite86 v0.2.17 │ └── rand_core v0.6.4 │ └── getrandom v0.2.9 │ └── cfg-if v1.0.0 …
Julia
  • 53
  • 3
0
votes
1 answer

how to override dependencies when using cargo

I am upgrade diesel to 2.x right now, and I found the public rust lib uses the legacy diesel. Is it possible to force the diesel to use 2.x version? I have tried to add cargo.override.toml file in the root project directory and specify the version…
Dolphin
  • 29,069
  • 61
  • 260
  • 539
0
votes
0 answers

Why are the Sui binaries always rebuilt with cargo

I've inherited the building of a backend that integrates with the Sui blockchain. The only Sui-related crate declaration I found is this: sui-sdk = { git = "https://github.com/MystenLabs/sui", rev = "09b2081" } I can see it corresponds to the…
Milkncookiez
  • 6,817
  • 10
  • 57
  • 96
0
votes
2 answers

Is there a way to specify a git branch in a path dependency in the Cargo.toml?

Let's say I have checked out a git repository locally and I would like to add a specific branch/tag as a dependency to a Cargo.toml of a rust codebase. Is there a way to do it? I've already tried the following without success: dep = { path =…
mp01
  • 1
0
votes
0 answers

Sublime Text - How to remove Code Lens for Rust Analyzer?

I’m using Sublime Text with the LSP and LSP Rust Analyzer packages. I would like to disable Rust Analyzer’s Code Lens. I’ve already done this in settings: // Settings in here override those in…
0
votes
2 answers

Tokio channel rust

I am trying to implement a Promise system with Tokio, I simulate the callback and the resolve, this is the code: use std::time::Duration; use tokio::sync::oneshot::{channel}; use tokio::time::sleep; async fn task_prom(callback: impl Fn(i32)) { …
danixl30 ct
  • 133
  • 2
  • 9