r/learnrust • • 15h ago

best way to learn rust?

5 Upvotes

hi. i develop using cpp. i want to learn rust to see what the hype is all about and build some systems (core) in rust. what's the best way to learn rust with my bg in cpp? should i learn it from scratch or learn by mapping it to cpp?


r/learnrust • • 7h ago

New to rust, how's my progress so far?

4 Upvotes

Hello, as you might have read from the title, i am new to rust, and being new to rust also means looking for ways to further improve, and one way to do that is to receive feedback, which i am seeking from this subreddit. I've read parts of the rust book and created projects in rust to put my skills to the test. I am currently working on a simple file IO CLI tool (https://github.com/reehanthenew/Simple-file-IO-CLI-tool/tree/main) and im currently proud of my progress. If i could receive some feedback (i accept any forms of feedback) that would be most appreciated. If i could receive more beginner-friendly projects or more learning materials, that would be much more appreciated. If you would like to monitor my growth, feel free to here: https://github.com/reehanthenew?tab=repositories


r/learnrust • • 9h ago

Rooomy tutorial

4 Upvotes

I wrote this for people who've programmed before but never touched Rust.

Each chapter is a folder you can build on its own and adds one thing: walking a folder, error handling with Result and ?, an arena tree that the borrow checker likes, rayon, atomics for live progress, a squarified treemap, safe delete, duplicate detection, then installers, signing, auto-update and package managers.

At the end you have Roomy, an app people actually use. Feedback on where it gets confusing would help a lot.

https://github.com/pravin/roomy#the-chapters

Please feedback 🙏


r/learnrust • • 1h ago

Checklist and CI tooling for auditing unsafe Windows FFI blocks (WinTUN, WFP, WASAPI/MediaFoundation)

1 Upvotes

a cross-platform privacy & vpn app in Rust that routes device internet traffic through itself to talk with Windows networking, firewall, microphone, and camera systems currently have to bypass automatic memory safety checks in some sections. Is there a manual review checklist or any auto testing tool which scans during build & see memory leaks or crashes


r/learnrust • • 6h ago

A relational database built in Rust as a learning project, supporting the SQLite binary file format.

Thumbnail reddit.com
1 Upvotes

r/learnrust • • 15h ago

Learning path for integrating llama.cpp into a Rust desktop app on Windows

1 Upvotes

I’m building a local semantic search desktop app in Rust and planning to change its inference engine from launching `llama-server` as a separate process to calling llama.cpp in-process through its Windows DLL.

I have basic deep learning knowledge and want to understand the full stack behind the setup like how llama.cpp runs models, how its C API and Rust FFI work, how the DLL is built and loaded, how GGUF embedding and multimodal models are handled, how CPU and GPU backends use the hardware, and how to package and distribute the application and its native dependencies reliably.

What documentation, videos, articles, or example projects would you recommend? I’d especially appreciate a sensible order to study them and practical resources that connect the model and hardware concepts to building a working Rust application.


r/learnrust • • 22h ago

E0308 when assigning an Option<Enum....>?

1 Upvotes

Hi everyone.

I have this bit of code (Extracted from something much larger) that is throwing up an error as follows:

#[derive(Clone, Debug)]
pub enum CutterComp {
    CompOff,
    LeftFromTool(Option<Expr>),
    RightFromTool(Option<Expr>),
}

Then in a structure definition :

#[derive(Debug, Default)]
struct StateUpdate {
.
.
.
  radius_compensation: Option<CutterComp>,
.
.
}

Then in an impl of Stateupdate :
  fn intepret_block(&mut self) -> Result<(), ErrType> {
  .
  .
  .
   if let Some (c) = self.grouped_gcodes[GCodeGroups::GRadiusComp as usize] {
            match c.0 {
                GCodes::G40 => {
                    trace!("Cutter compensation off");
                    self.radius_compensation = Some<CutterComp::CompOff>;
                }
                GCodes::G41 => {
                    trace!("Cutter compensation left");
                 self.radius_compensation =           Some<CutterComp::LeftFromTool((self.axis.get(&"d")))>;
                }

Where the thing blows up with

error: comparison operators cannot be chained
  --> src/main.rs:259:52
   |
259 |                     self.radius_compensation = Some<CutterComp::CompOff>;
   |                                                    ^                   ^

Any ideas?

Rust usually gets types right almost by magic (Old C hand here), but it seems to think that I have a bool or something.

Rust analyser is saying "expected Option<CutterComp>, found bool" which I do not understand.