9 Rust Best Practices with Real Lib (part 1/3)

Опубликовано: 13 Февраль 2026
на канале: Jeremy Chone
20,811
931

Here are 9 Rust Programming best practices I am using when building a library. We will use a real library, genai, as an example.

GitHub (at v0.1.5, this video code version): https://github.com/jeremychone/rust-g...

Part 1 (this one):    • 9 Rust Best Practices with Real Lib (part ...  
Part 2:    • 9 Rust Best Practices - Utils, Examples, T...  
Part 3:    • 9 Rust Best Practices - Async, Project Fil...  

This is part of a 3-part series, and in this episode, we will focus on the following Rust Programming best practices,

1) Module Structure - Rust Nampespacing, Scoping and code orgnaization
2) Rust Error Handling practices
3) Rust Constructors, chainable setters, and builder patterns and best practices.

00:00 - Intro
00:10 - c01: Module Structure
06:14 - c02: Error Handling
11:57 - c03: (a) Constructors, Builders, Setters
22:45 - c03: (b) Constructors/builders Code example

== Jeremy Chone:

Discord general-rust -   / discord  
Discord rust10x -   / discord  
Patreon -   / jeremychone   - Any help is a big help (for Rust educational content)
Twitter -   / jeremychone  

https://britesnow.com - BriteSnow is my enterprise consulting company I have been running for 15 years. We help enterprises build and modernize next-gen applications. Feel free to send an email to [email protected] if you have any questions.


Big thanks to CrabNebula (https://crabnebula.dev/) for sponsoring this channel.

== Jeremy Chone Rust Video Playlists:

Rust AI Programming Series:    • JC - Rust & AI Programming  
Rust Web App Production Coding Series:    • JC - Rust Production Coding - Web App Series  
Rust For Desktop App:    • JC - Rust Programming for Desktop App  
Everything Rust Programming - Tutorials, Courses, Tips, Examples:    • JC - Rust - Everything Rust Programming - ...  
Rust Programming for Web Development:    • JC - Rust Programming for Web Development  
Rust Courses:    • Rust Course 2021 by the book | RustLang  
Rust for Java Developers:    • Rust for Java Developers