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].
rust
41,931
questions
-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 ...
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 ...
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 ...
-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 ...
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 ...
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 ...
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) -&...
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", ...
-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 ...
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::&...
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 ...
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/
│...
-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/...
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:...
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 ...