Skip to main content

Questions tagged [rust]

Rust is a systems programming language without a garbage collector focused on three goals: safety, speed, and concurrency. Use this tag for questions about code written in Rust. Use an edition specific tag for questions that refer to code which requires a particular edition, like [rust-2018]. Use more specific tags for subtopics like [rust-cargo] and [rust-macros].

-1 votes
0 answers
9 views

What is wrong with my voxel terrain generator. Terrain generator is not making seamless terrain

So as the title says, I'm making a voxel engine using rust and bevy and I am currently working on the terrain generation. I decided to use a heightmap that was made using simplex noise. This is how a ...
Kingdawnage's user avatar
0 votes
0 answers
18 views

unsure how to resolve sqlx error : "error with configuration: no driver found for URL scheme "postgres""

I'm following along zero to production book and I've reached the point where I'm supposed to create a database connection with sqlx and Docker. I've been following all the steps in order to establish ...
NoodleSama's user avatar
0 votes
1 answer
30 views

How are event handlers with unknown number of parameters done in popular crates?

I'm noticing more and more often that different rust crates use registration of event handlers with any set of parameters the user wants, not the library developer. I have seen this in the following ...
John Darkman's user avatar
-1 votes
0 answers
20 views

Reading a specific value based on an indexed dataframe in rust with polars

I am trying to read a value from a dataframe based on index and column on rust. I do not know how to create an indexed dataframe. I have been unable to find much information on this. For instance, if ...
JBody's user avatar
  • 1
1 vote
0 answers
12 views

wgpu buffer size overrun while applying gaussian blur filter

I recently started to learn Rust, and I decided to learn by porting a project to Rust. The source code is available publicly. I first encountered an alignment issue. I tried some changes to ...
Ajat Prabha's user avatar
0 votes
1 answer
40 views

How can I get the network list with WlanGetAvailableNetworkList using windows-rs in Rust

I am trying to get the list of all available networks using WlanGetAvailableNetworkList. When I loop over the array of networks based on dwNumberOfItems it only shows me the first network and anything ...
ymgpwcca's user avatar
0 votes
0 answers
32 views

Rust mockall crate, no method named `returning`

I am using mockall crate for unittest. #[cfg_attr(test, automock)] pub trait Reader { fn next_data(&mut self) -> &Data; } impl Reader for TestReader { fn next_data(&mut self) -&...
leeway00's user avatar
  • 127
0 votes
1 answer
30 views

Rust Iterate through a vector of string and mutate the contents

I am a newbie in Rust. I want to iterate through a vector of String and modify the values. How will one do it? Below is the code I wrote, but it fails. let mut val: [&str; 3] = ["Hello", ...
BoringSession's user avatar
-1 votes
0 answers
12 views

Failed to run custom build

I'm trying to run the bench tests for Block-STM and I keep running into this error: error: failed to run custom build command for `librocksdb-sys v6.20.3` Caused by: process didn't exit ...
fikunmi's user avatar
  • 21
0 votes
1 answer
40 views

Why is 'static lifetime needed in this scenario?

I am currently learning Rust by making a dummy ECS, given the following function: pub fn add_component<T: Component + 'static>(&mut self, component: T) { let type_id = TypeId::of::&...
frankelot's user avatar
  • 14.2k
0 votes
0 answers
26 views

How can I add a "std=c99" flag to cc when compiling using cargo?

I'm trying to install ripgrep (link to repo) with the pcre2 feature from source. To do so I run the command cargo build --release --feature 'pcre2' to build the exec. When doing so, cargo tries to ...
m.raynal's user avatar
  • 3,053
0 votes
1 answer
29 views

mixed pyo3 project not compiling everything

I have a pyo3 project lclPy and as per the book of pyo3 this is part of the project structure. lclPy/ ├── src/ │ ├── io/ │ ├── local_search/ │ ├── problem/ │ ├── termination/ │ └── lib.rs ├── python/ │...
milan Schollier's user avatar
-6 votes
0 answers
39 views

How do you learn to use rust crates when most of them do not contain usage documentation? [closed]

Here's an example: https://rustwasm.github.io/wasm-bindgen/api/wasm_bindgen_futures/ That's the api documentation. Compare that to this: https://developer.mozilla.org/en-US/docs/Web/JavaScript/...
Andrew Luhring's user avatar
0 votes
1 answer
31 views

Pass environment variables to tests but not the cargo binary

For example, I want to run the test with MALLOC_CONF="prof:true,prof_active:false", so I could just do LD_PRELOAD=jemalloc-5.2.1/lib/libjemalloc.so.2 MALLOC_CONF="prof:true,prof_active:...
calvin's user avatar
  • 2,695
0 votes
0 answers
14 views

ARPACK producing nonsense eigenvalues?

I am trying to use arpack from within rust and I am getting weird results. In order to test if I was correctly interfacing with arpack, I decided to make a sparse symmetric tri-diagonal Toeplitz ...
Makogan's user avatar
  • 9,191

15 30 50 per page
1
2 3 4 5
2796