r/learnrust • u/Ambitious-Dig7271 • 1h ago
Suggestions for Rust Course
I am currently learning Rust programming language and want to enroll into a course for better guidance and projects . Someone help me choose the best available course on Udemy.
r/learnrust • u/Ambitious-Dig7271 • 1h ago
I am currently learning Rust programming language and want to enroll into a course for better guidance and projects . Someone help me choose the best available course on Udemy.
r/learnrust • u/WaferYield100 • 12h ago
New rust learner/hobbyist, trying my hand in embedded software. Started with the discovery book, and in it, chapter 7 is a challenge to make an led roulette. Earlier me would have (and have) written a garbled mess of if/else statements, but this time I thought of doing it with a match statement and I'm kinda proud of that... hopefully this is me starting to think idiomatically :-)
The interesting part of the solution: (I know its a simple problem, and the solution isn't that complicated, but a win is a win...) (All feedback is appreciated, on the code, and on rust journey in general)
struct CurrentFrame {
matrix: [[u8; 5]; 5],
pos: (usize, usize),
}
impl CurrentFrame {
fn next_frame(&mut self) {
self.matrix[self.pos.0][self.pos.1] = 0;
match self.pos {
(_,0) => {
if self.pos.0>0 {self.pos.0 -= 1}
else {self.pos.1 += 1}
},
(4,_) => self.pos.1 -= 1,
(_,4) => self.pos.0 += 1,
(0,_) => self.pos.1 += 1,
_ => (),
}
self.matrix[self.pos.0][self.pos.1] = 1;
}
}r/learnrust • u/fernandopereira08 • 13h ago
Hi everyone! I'm making a YouTube series where I build a wallet and payments REST API in Rust, one small step at a time. It's aimed at people who know basic Rust and want to see how it's used to build a real backend.
It starts with a single Axum route. So far it covers CRUD with shared state, error handling with thiserror, type-safe validation, PostgreSQL with SQLx, and the repository pattern with traits. Next up are integration tests, accounts, money transfers, race conditions, auth and idempotency.
Transparency note: I cloned of my own voice because English isn't my first language.
If you're learning Rust, I'd really appreciate your feedback:
- Is the pace OK, or did you get lost anywhere?
- Which concept felt unclear or rushed?
- Is the code readable on screen?
- What would you like to see in future episodes?
Thanks for taking a look!
r/learnrust • u/luminade-studios • 1d ago
You want to see how to add an SVG inside an SVG, watch this episode to find out.
Thanks for watching
Matthew
r/learnrust • u/sebastvnd • 1d ago
I've been working on CursorPie, a cross-platform radial launcher written in Rust, and one of the most interesting challenges has been building its global gesture engine.
The tricky part isn't simply detecting mouse input. It's handling press, hold, flick, double-click, and release events without blocking the input path or interfering with normal mouse interactions.
The architecture separates input hooks, gesture state management, timers, action execution, and UI updates into dedicated threads.
One particularly interesting mechanism is swallowing and replaying mouse clicks: CursorPie temporarily intercepts input to determine whether it represents a gesture, then replays ordinary clicks so the target application still receives them.
Different platform backends, one shared gesture model.
I'm sharing a look inside the engineering behind it. Curious how other Rust developers approach low-level input handling and event-driven architectures.
CursorPie: https://github.com/sebastvnd/cursorpie
r/learnrust • u/EuroRust • 1d ago
A new video is out on YouTube! At this year's EuroRust, Jana from the Rust Compiler Team gave a talk on optimizing rustc’s next trait solver, which is being stabilized this year. Spoiler alert: the real gains weren’t in micro-optimizations, but at the algorithmic level! 🦀
In 2027 EuroRust is going to Prague! Learn more and get your ticket at eurorust.eu.
r/learnrust • u/Big-Astronaut-9510 • 2d ago
Imagine a route like "/{country}/{city}/{state}" , then you would write the handler like "Path((country,city,state)): Path<String,String,String>" .
The problem (atleast that i cant find first party solution to) is the route and handler will be specified in two different places in your code. But the path type and each elements position depends on the route. This seems very error prone to me.
r/learnrust • u/urgyeev • 2d ago
I'm building an app that loads and stores a bunch of structs in memory throughout its execution: plugins, commands, shortcuts etc. I'm trying to figure out how to properly manage application state.
For example, whenever I remove a plugin, I want to ensure that all its child commands are dropped as well. One obvious solution is to define a single struct that holds all the state and methods like add_command, remove_plugin etc. But this collocates unrelated methods and lacks proper namespacing.
If I move these methods to their corresponding structs instead, how should I handle cross-state operations such as removing a plugin and all its associated commands?
What would be the most idiomatic approach in Rust? I've been digging through the net for days, and people often mention ECS as a solution, but isn't that mostly a game dev thing?
Would love to hear your thoughts!
r/learnrust • u/Status-Aside-5583 • 3d ago
I'm learning Rust, currently studying ownership and borrowing, and I'm confused about what happens when returning a reference from a function.
Here's my code:
fn main() {
let s1 = String::from("Hello world");
let word = practice(&s1);
}
fn practice(s: &String) -> &String {
return &s;
}My understanding:
s in practice is already a reference to a String (&String).&s, am I creating a reference to that reference (&&String)?&String?&&String into &String?I'd appreciate an explanation of what's happening here, especially regarding references, dereferencing, and return types.
r/learnrust • u/Status-Aside-5583 • 4d ago

So , i read the original book ownership chapter it made sense but then i went to brown unverisity and boy i cant wrap my head around the same concept
see this what i know are:
1.when we create a mutable or immutable refernce to the original owner or its value with *
it removes corresponding permissions
2. When we create a reference pointing to another refernce this part i dont understnd like see above ss it says that after we assign z a mutable reference to *y , y and *y both lose write permission if they both lose write permission then how can i be able to reassign y in next step???
This is my own understanding but if u create a immutable refernce to a *y it only removes write from *y and not Y and if u make a immutbale reference to y itself it removes write from both
plus the rest of book has permisson system too so should i forget what i learned al together and focus on main book or is there a way to learn this permisson thing
r/learnrust • u/md_Fahad25624 • 6d ago
I'm a beginner, learning coding newly, my first serious language is Rust. This is my GitHub link, there are some small projects here, I'll be glad to accept reviews.
r/learnrust • u/bodiam • 6d ago
(logo enhanced with AI, but created by my talented 7 year old niece. proof)
Hi all. A lot of people are wondering if it's still worth learning to program now that AI is more than capable of doing this. These people are often the people who already have 10 years of programming experience, and aren't the ones just getting started with things. Also, is it ever worth learning something for the mental challenge? I'd think so, plus it helps to understand what the AI is doing; if it's good code or bad code.
So, with that in mind, I created a small website, https://learnmap.sh, which teaches programming in a wide range of languages. It's inspired by a website I liked a lot myself (https://vimjoyer.com/nixmap/), and a bit by Duolingo. It's mostly focused on beginner programmers, but while I'm an experienced developer myself (20+ years), going through the Rust and Zig tutorials taught me a lot.
Anyway, just wanted to share the site. There's no accounts (all progress is stored locally), there's no banners, no ads, just a small way to contribute some fun weekend project. If you have some feedback, thoughts, you'd like to see anything extra, I'd love to hear your thoughts!
update: the source code is available here, for those interested: https://github.com/learnmapapp/learnmap
r/learnrust • u/Foreign_Career_454 • 7d ago
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 • u/More-Reception-2496 • 7d ago
r/learnrust • u/OkBug7820 • 7d ago
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 • u/_mrcrgl • 7d ago
r/learnrust • u/byterider • 7d ago
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 • u/No-Elephant-9065 • 8d ago
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 • u/Creative_Concert8682 • 8d ago
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 • u/dmills_00 • 8d ago
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.