43,952 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
Best practices
0
votes
2
replies
98
views
Atomic concurrency: when do I need something stronger than Ordering::Relaxed?
I am building some concurrent Rust code and trying to optimize a few small pieces of shared state using atomics such as AtomicBool.
One thing I am still struggling to understand is when Rust code ...
- reputation score 56
Score of 1
0 answers
78 views
How to specify platform-specific dependencies in Rust Cargo?
I need to use a crate which is hosted in my company's GitHub repo. There are two versions of this same crate for different OSes, namely vxworks and linux. In my application I have added this crate in ...
- reputation score 4537
Score of 4
1 answer
138 views
Why does Rust throw an error for a `[u8; isize::MAX as usize / 4 + 1]`, even though the theoretical allocation limit is `isize::MAX`?
Here is a reproducible example:
fn main() {
let _: [u8; isize::MAX as usize / 4];
let _: [u8; isize::MAX as usize / 4 + 1];
let _a: [u8; isize::MAX as usize / 4];
let _b: [u8; isize::...
- reputation score 277
Score of 1
1 answer
164 views
How to get the size metadata of a block device?
Given a block device, how do I get the size metadata of that block device programmatically? Using Linux command df -h, I can see what's the total memory size allocated, occupied size, etc of all the ...
Best practices
0
votes
1
replies
74
views
External-memory approach for BPE training where merges depend on text adjacency (160 GB corpus)
I have a Byte-Pair Encoding tokenizer with an extension called supermerges (ref., arXiv 2504.00178). Supermerges join two words that sit next to each other in the text, so for training I have to load ...
- reputation score 1
Advice
0
votes
1
replies
85
views
Two Rust crates each bundle their own libcrypto (OpenSSL + BoringSSL) and fight over the same symbols — what's the right way to deal with this?
Spent way too long on this one so I'm hoping someone's hit it before.
I've got a desktop app in Rust. Two of my dependencies each drag in their own copy of a C crypto library:
rusqlite with bundled-...
Advice
0
votes
6
replies
156
views
What are Rust Crates
I'm learning Rust and I'm very new so I was learning about the sort of "environment" to Rust (Cargo, etc.) and I have been struggling so much with the concept of rust crates. I've gone to so ...
- reputation score 1
Score of 0
0 answers
62 views
Move a gpui window by code, just like a popup message does
I have a gpui application; when I run the application, it starts a main window, within the window I have a few controls and a button. If I click on the button, it will show a popup window at the right ...
Score of 0
1 answer
94 views
I'm using Rust + Macroquad's and my ball's position ends up on the wrong side?
I've been learning rust for a few days now, and I am trying to make a ball bounce simulation. It worked before but after I added delta it's started breaking, and the ball spawns in at the bottom and ...
- reputation score 3
Score of 0
0 answers
81 views
POST endpoint with data stream in Actix Web in Rust
I am doing a Rust project with Actix Web and I need a POST endpoint that takes a data stream. It needs to be stream because it's about 100 gigabytes of data that gets sent in one request. That's what ...
Score of 1
0 answers
82 views
ubuntu 24.04 rust-lld cannot find some libraries despite them being installed
I'm trying to build zedless in an ubuntu dev container. I've installed dependencies including libxkbcommon-dev and libasound2-dev
root@657127a23829:/workspaces/zedless_build/zedless-patches/source# ...
- reputation score 1483
Advice
0
votes
16
replies
532
views
Should I keep learning C++ or switch to Rust?
I am currently learning physics, math, and embedded systems programming while trying to sharpen my overall software development skills. To combine all these subjects into a fun, hands-on project, I am ...
Score of 0
1 answer
96 views
Figuring out correct trait bounds for rust diesel-async async closure transaction
With recent changes to rust diesel async where it supports async closure for transaction, I want to do the same for my wrapper instead of passing a boxed future.
I would like to update txw to call it ...
Score of 0
1 answer
115 views
Why does the concat! macro not work for const variables? [duplicate]
Since const variables are evaluated at compile time, why is it not possible to use them while concatenating multiple const &str variables using the concat! macro?
I followed this guidebook as it ...
Tooling
0
votes
2
replies
143
views
What GUI frameworks are suitable for building a Krita-like image editor in Rust?
I'm planning to develop a desktop image editing application similar to Krita using Rust.
Most professional image editors are built in C++ and use mature GUI frameworks such as Qt, which provide ...
- reputation score 1