u/nima2613in r/rust • Recommends
On “How to properly deal with invariants”
You can try type state pattern:
link to this video
#typestate-pattern#generics#zero-sized-types
177K subscribers • 8 videos on Hallway
Intermediate. Assumes working knowledge.
122K views3 years ago3 recommendations
Programming languagesSoftware designRustAPI designDesign patterns
How to design misuse-resistant Rust APIs using generics, zero-sized types, and the typestate pattern.
Join our Rust Live Accelerator waitlist (free Rust Job-Ready Roadmap inside): letsgetrusty.com/join Let’s Get Rusty is the #1 Rust education & career development platform for engineers who want real-world skills and results. We combine a structured curriculum, industry-grade projects, expert review and feedback, and our Rust recruiter network — to help you master Rust and get hired. · Today I'm teaching you how to build Rust APIs that are impossible to misuse by taking advantage of generics and zero-sized types! FREE Rust Cheat Sheet: letsgetrusty.com/cheatsheet Code: github.com/letsgetrusty/generics_and_zero_sized_types Chapters: Intro Example overview First solution Second solution Third solution OutroWhat people say. Recommended as a helpful guide for implementing the typestate pattern to enforce invariants at compile time.
u/nima2613in r/rust • Recommends
On “How to properly deal with invariants”
u/pfharlockkin r/rust • Recommends
On “The peer pressure to learn rust.”
u/Jonasksin r/rust • Recommends
On “Some questions from a noob Rustacean”