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

How do I extract binary invocation from `cargo run` on macos?

Context When I was trying to run a Criterion.rs benchmark as a standalone binary, I carried out the following steps: Run cargo bench. This shows me the path to the binary (target/release/...): > cargo bench --features dhat-heap --bench…
Noel Kwan
  • 123
  • 1
  • 5
0
votes
0 answers

Rust incremental compiler : Undefined symbols for architecture x86_64

I was trying out Rust for the first time and was playing around with unsigned literals. When I run the following program fn main() { println!("{x}", x = 1 - 2); } all is well and good, you get the expected output of -1. When I changed the…
0
votes
1 answer

rust crate dependencies: norman::Norm trait is not defined for ndarray::Array1

I am trying to get a P-norm for my simple 1D Vec in Rust, but I am failing with every norman example. Error states that there is no method named `norm` found for struct `ArrayBase` in the current scope. What I did: cargo new norman-test cd…
0
votes
0 answers

Termux(rust) cargo run error: permission denied

When im trying to use cargo build or cargo run it results error: permission denied 13. Here's the error. I already installed root-repo and gave storage access to termux, i also tried to use "chmod +x build-script-build" but nothing helped, my phone…
0
votes
0 answers

Running Rust unit tests inside the "tests" directory

I have a standard Rust/Cargo-based codebase including the usual src folder containing production code and the usual tests folder containing integration tests. The integration tests are so complex that I would like to unit test parts of my…
Kevin Goslar
  • 357
  • 3
  • 8
0
votes
0 answers

message":"Missing access token for authorization

I am new to rust programming and trying to make an email summarizer, I have authenticated it but now when I am calling messages_get function I am getting the following error. I am using google_gmail1 crate Here is the error : Bad Request:…
glitch_123
  • 139
  • 12
0
votes
1 answer

Failed to run custom build command for `libgpg-error-sys v0.6.0` when cross compiling rust project using cross

Whenever I try to cross compile my rust project on my Machine running arch linux, using cross for the x86_64-unknown-linux-gnu architecture I get this error $ cross build --target x86_64-unknown-linux-gnu …
0
votes
1 answer

'main' panicked at 'attempt to subtract with overflow',

I am fairly new to rust and trying to connect to gmail api to read emails. I am using yup_oauth2 to authenticate and then google_gmail1 to read emails. here is my code use yup_oauth2::{InstalledFlowAuthenticator, InstalledFlowReturnMethod}; use…
glitch_123
  • 139
  • 12
0
votes
0 answers

Is there a way to mock the target_os config for a specific crate?

I want to add the dependency mac_address to my crate, that doesn't officially support the target os android. I observed that mac_address compiles for android by just adding target_os = "android" to the conditional compiling blocks of that crate. So…
0
votes
0 answers

Cargo install command fails with network error when trying to install a Rust crate

I'm a beginner trying to set up a Rust project on my computer. I've installed Rust from the official website and I'm trying to install the cargo-ndk crate using the cargo install command, but I keep getting a network error. Here's the error message…
0
votes
0 answers

Document Python module coded in Rust and cpython

I want to document the functions of my python library. I coded it using Rust and the cpython crate. An example of a function follows: Rust function signature: async fn get_problem(num: u16) -> Result { ... } Rust function…
0
votes
1 answer

Buffer.clear() is working but buffer.pop() isn't

I'm new to Rust and wanted some help because I can't figure out why this simple code is not working. I'm using rdev library and I'm just trying to store the typed key in a buffer and delete the last letter when I press backspace key. What is weird…
1020rpz
  • 914
  • 10
  • 21
0
votes
0 answers

Access/Generate all Android SDK classes in a Rust library

I want to access all Android SDK classes in a Rust library, and perform some operations on the Android system. Here is the example list of classes/packages that I want to access android.hardware.usb.* (UsbManager,…
0
votes
1 answer

The terminal process failed to launch: Path to shell executable "/path/on/project/cargo" does not exist

My remote server environment is Windows. After installing rust-analyzer in Visual Studio Code, I tried to use the plugin to generate Run test commands in the code. However, I encountered an error similar to the following: Executing task:…
linonon
  • 3
  • 3
0
votes
1 answer

Using Cargo.lock to effectively manage & pull dependency versions in my crates

My workspace looks like this: workspace |--other_crate <== existing crate relying on tokio |-- Cargo.toml |--my_crate <== this is a new crate called using "cargo new --lib" |-- Cargo.toml |--Cargo.lock …
pe pe
  • 31
  • 2
1 2 3
99
100