Build with Naz : newtype design pattern, and impl Into T for ergonomic APIs
This video shows how you can use newtype design pattern, and into Impl T. I use an example of building structs to do 2D layout and sizing without using newtype design pattern and demonstrate the pitfalls of using usize everywhere. Then convert it to use newtype pattern, into Impl T, to get all the benefits. Remove entire classes of problems from even existing, thanks to the Rust compiler. For comments and feedback please use these: Repo: https://github.com/nazmulidris/rust-s... Issues: https://github.com/nazmulidris/rust-s... References: https://doc.rust-lang.org/rust-by-exa... • Jacob Pratt: "Compiler-Driven Development:... Chapters: 00:00:00 Intro 00:06:04 Ex 1: Using usize for everything and the issues 00:19:35 Ex 2: Use newtype to create core types - X, Y, Width, Height 00:30:28 Ex 3: Use newtype to create Point & Size types 00:39:28 Ex 4: Use into Impl T for X, Y, Width, Height from usize, f64, etc 00:53:05 Ex 5: Use Add to add X & Y to make Point 01:02:05 Ex 6: Allow conversions between Width - X and Height - Y types 01:24:32 Ex 7: Impl Drop and newtype 01:36:00 Outro

Build with Naz : Rust memory address and size

Build with Naz : Rust, Memory performance & latency - locality, access, allocate, cache lines

7 Design Patterns EVERY Developer Should Know

Zig 2026: No-AI Policy, $670K Foundation, Left GitHub & Why Zig Isn’t 1.0 - Andrew Kelley Explains

A Practical Guide to Async IO in Zig

Why Aliens Would NEVER Invade Africa

Linus Torvalds: AI Is Changing Linux Fast

Keynote: After the AI Hype – What’s Real, and What’s Next - Richard Campbell - 2026

I Found Hidden Wires… Then the CTO Emailed Me.

How Instagram Scaled Postgres to 2 Billion Users

The magic of Rust's type system

Casey Muratori – The Big OOPs: Anatomy of a Thirty-five-year Mistake – BSC 2025

Build with Naz : traits, subtyping, polymorphism in Rust

Creator of C++: Bell Labs, Negative Overhead Abstraction, Mistakes | Bjarne Stroustrup

Historian Timothy Snyder on ENDING Trump Nightmare FOR GOOD | PoliticsGirl

Inside the Mind of Anthropic CEO Dario Amodei | The Circuit | Extended Interview

What The Architect Scene in The Matrix ACTUALLY Means

Something is jamming GPS over Europe. Here's what we found

Build with Naz : Rust subtyping and variance

