43,946 questions
2
votes
1
answer
49
views
rustc logging for the optimization stage of a build
The optimization stage of building my rust program takes a really long time. I determined this by adjusting the cargo profile settings opt-level and lto.
I want to better understand what is happening ...
2
votes
2
answers
55
views
rust cargo default profiles; all values
rust cargo has two default proviles, dev and release, described in The Cargo Book, section Profiles.
However, I'm not sure the The Cargo Book explains all of the possible profile options. But moreso, ...
-4
votes
0
answers
57
views
WouldBlock in Rust Wifi manager causing errors [closed]
I'm building a wifi manager (daemon) and I'm facing an error whenever I'm trying to connect my local WiFi through the DORA handshake.
I am getting the request and reply from the interface (checked ...
0
votes
1
answer
94
views
get rust default stack size at runtime
How do I get the default rust stack size at runtime?
Looking at the rustc code, there exists a pub static STACK_SIZE. But how do I access this value from std or core?
I know stack size varies by ...
Advice
0
votes
1
replies
47
views
Move into closure also when only reference is used?
Maybe I shouldn't be confused, everything is working fine. But I was wondering how the rust compiler determines what to move into the closure since that's implicit. Compare the following code, ...
Best practices
0
votes
4
replies
169
views
Programmer owns the architecture, AI implements crate-level modules in Rust — how does this compare to other languages?
After working on several Rust projects with AI assistance, I want to share a division of responsibility that has worked well in practice, and ask whether others have found the same — or a better ...
Best practices
0
votes
0
replies
36
views
Atomic Blob Storage Operations
Context: Writing a distributed file syncing service similar to dropbox using azure blob storage. When an upload is necessary, my colleague recommended that I create pre-signed blob urls that are sent ...
Advice
1
vote
1
replies
60
views
Mocking time using cfg(test)
I have library that needs current unix time in its internals and produces output based on this time.
To test such library I need deterministic time to get deterministic output, so this is my current ...
2
votes
0
answers
80
views
panicked at condvar wait not supported when running MobileNetV2 with Burn/Wgpu in WASM
Lately, I've been learning how to use WebGPU and WebAssembly to run image classification models in web browsers.
I used Rust, WASM, and Burn. I noticed that the burn-onnx repository contains an ...
Advice
0
votes
0
replies
32
views
Libp2p Rust tutorial
I'm trying to learn how rust-libp2p and I would like to know how one can start on such a massive crate. On which components should I first look in order to understand its internals?
I want to get to a ...
Advice
0
votes
5
replies
78
views
Understanding the use of `'static` in RusTLS
As a (relative) novice at Rust, I am trying to understand the use of 'static in the RusTLS CommonState struct's peer_certificates method:
pub fn peer_certificates(&self) -> Option<&[...
Tooling
1
vote
4
replies
141
views
How to measure structural similarity between programs written in different languages
I’m working on a project where I translate C programs into Rust and I want to measure how much structural similarity is preserved between the original C code and the translated Rust code. What is the ...
Best practices
0
votes
1
replies
63
views
Multi-provider RPC failover in Rust - circuit breaker vs retry-only for blockchain nodes?
I'm building a production RPC transport layer in Rust that connects to
multiple blockchain RPC providers (Alchemy, Infura, QuickNode, public nodes)
with automatic failover.
The challenge: not all ...
2
votes
1
answer
100
views
Alignment issue on context switch on a custom kernel
I'm writing a kernel in rust and assembly for embedded system in RISC-V 32 bits for several month now. I just notice today that when I run some task, after a certain amount of time, my kernel panic ...
Best practices
0
votes
11
replies
155
views
How to avoid repeatedly passing a string slice to helper method without adding lifetime?
How can I avoid repetition of passing val every time? In c++ I would just create a field in a class but in rust it's not so simple because &str requires a lifetime.
impl MyStruct {
fn b(&...