MENU

Fun & Interesting

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

Jeremy Chone 16,087 9 months ago
Video Not Working? Fix It Now

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-genai/tree/v0.1.5 Part 1 (this one): https://www.youtube.com/watch?v=XCrZleaIUO4&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q Part 2: https://www.youtube.com/watch?v=LRfDAZfo00o&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q Part 3: https://www.youtube.com/watch?v=93SS3VGsKx4&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q 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 - https://discord.gg/W2besKCzjx - Discord rust10x - https://discord.gg/XuKWrNGKpC - Patreon - https://patreon.com/jeremychone - Any help is a big help (for Rust educational content) - Twitter - https://twitter.com/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: https://www.youtube.com/playlist?list=PL7r-PXl6ZPcBcLsBdBABOFUuLziNyigqj - Rust Web App Production Coding Series: https://www.youtube.com/playlist?list=PL7r-PXl6ZPcCTTxjmsb9bFZB9i01fAtI7 - Rust For Desktop App: https://youtube.com/playlist?list=PL7r-PXl6ZPcAQAi1lfVrtHCSbaJbwZ4O8 - Everything Rust Programming - Tutorials, Courses, Tips, Examples: https://youtube.com/playlist?list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q - Rust Programming for Web Development: https://youtube.com/playlist?list=PL7r-PXl6ZPcCLvwpdD2Vj1O4CyoFTiHKd - Rust Courses: https://youtube.com/playlist?list=PL7r-PXl6ZPcB4jn1_VR3D8tSK9DxOaiQE - Rust for Java Developers: https://youtube.com/playlist?list=PL7r-PXl6ZPcD63DS2djSiz4SlXkaTfobc

Comment