Rust: Deref Trait

The Dev Method November 24, 2022
Video Thumbnail
The Dev Method Logo

The Dev Method

View Channel

About

No channel description available.

Video Description

#rust #traits #dereference The Deref trait provides Rust with the info it needs to customize the deference * operator for you custom data types. 0:00 intro 1:14 Following the Pointer to the Value 4:16 Using Box Like a Reference 5:26 Defining Our Own Smart Pointer 6:37 Treating a Type Like a Reference by Implementing the Deref Trait 8:44 Implicit Deref Coercions with Functions and Methods 12:32 How Deref Coercion Interacts with Mutability Links Chapter 15 section 2 Treating Smart Pointers Like Regular References with the Deref Trait https://doc.rust-lang.org/book/ch15-02-deref.html#treating-smart-pointers-like-regular-references-with-the-deref-trait Chapter 10 “Implementing a Trait on a Type” https://doc.rust-lang.org/book/ch10-02-traits.html#implementing-a-trait-on-a-type Chapter 5 “Using Tuple Structs without Named Fields to Create Different Types” https://doc.rust-lang.org/book/ch05-01-defining-structs.html#using-tuple-structs-without-named-fields-to-create-different-types Chapter 19 Advanced Traits https://doc.rust-lang.org/book/ch19-03-advanced-traits.html Twitter @thedevmethod

You May Also Like

Upgrade Your Gear Hauling

AI-recommended products based on this video

Loading...
MAXGROOM Bikini Trimmer Women, 3-in-1 Waterproof Electric Razors Shaver for Pubic Hair, Rechargeable Body Hair Trimmer for Underarm Leg Arm with LED Light and Travel Pouch

MAXGROOM Bikini Trimmer Women, 3-in-1 Waterproof Electric Razors Shaver for Pubic Hair, Rechargeable Body Hair Trimmer for Underarm Leg Arm with LED Light and Travel Pouch

(29)
$49.99
FREE delivery Wed, Aug 20
50+ bought in past month
Loading...
Waxed Canvas Multi-Purpose Waterpoof Tool Organizer Bags, Portable Carry On Pouch with 1 Small Detachable Tool pouch and 1 Zipper Pockets, 23.5" X 10.5"|ArmyGreen

Waxed Canvas Multi-Purpose Waterpoof Tool Organizer Bags, Portable Carry On Pouch with 1 Small Detachable Tool pouch and 1 Zipper Pockets, 23.5" X 10.5"|ArmyGreen

(27)
$32.86$29.86
FREE delivery Mon, Aug 11 on your first order
Loading...
NIDOO 15.6 Inch Laptop Sleeve Case Water-Resistant Protective Cover Portable Computer Bag Pouch for 15.6" Lenovo Yoga Chromebook / 15.6" Lenovo Ideapad 330 330S / 15.6" Lenovo Legion Y730, Dark Grey

NIDOO 15.6 Inch Laptop Sleeve Case Water-Resistant Protective Cover Portable Computer Bag Pouch for 15.6" Lenovo Yoga Chromebook / 15.6" Lenovo Ideapad 330 330S / 15.6" Lenovo Legion Y730, Dark Grey

(7,311)
$23.99
FREE delivery Sat, Jun 21 on your first order
Loading...
Birosnsy Digital Camera 4K 50MP with 32GB SD Card 2.88" IPS LCD Screen Auto Focus 16xDigital 9 Shooting Modes Zoom Entry Beginner 0.23LB HD Portable Mini Camera(Black, Batteries X2, Charging Head X1)

Birosnsy Digital Camera 4K 50MP with 32GB SD Card 2.88" IPS LCD Screen Auto Focus 16xDigital 9 Shooting Modes Zoom Entry Beginner 0.23LB HD Portable Mini Camera(Black, Batteries X2, Charging Head X1)

(109)
$42.99
PrimeFREE delivery Sat, Jun 14
Loading...
Wireless Lavailer Microphone for iPhone, Android, Camera, iPad, USB C, 4 in 1 Professional Mini Microphone with Noise Reduction, Wireless Mic for Video Recording, Vlog, YouTube, TikTok

Wireless Lavailer Microphone for iPhone, Android, Camera, iPad, USB C, 4 in 1 Professional Mini Microphone with Noise Reduction, Wireless Mic for Video Recording, Vlog, YouTube, TikTok

(329)
$22.99
FREE delivery Sat, Jun 14 on your first order
300+ bought in past month
Loading...
3-in-1 Professional Wireless Lavalier Microphone for iPhone, Android, Camera – 328ft Range, 20H Battery, Wireless Microphones, Noise Canceling for Recording, Live Streaming, YouTube, TikTok
Best Seller

3-in-1 Professional Wireless Lavalier Microphone for iPhone, Android, Camera – 328ft Range, 20H Battery, Wireless Microphones, Noise Canceling for Recording, Live Streaming, YouTube, TikTok

(248)
$69.99
PrimeFREE delivery Sat, Jun 14
500+ bought in past month
Loading...
G4Free Tactical EDC Sling Bag, Military Sport Shoulder Backpack Crossbody Daypack Satchel for Hiking Hunting Trekking Fishing OEKO-TEX STANDARD 100

G4Free Tactical EDC Sling Bag, Military Sport Shoulder Backpack Crossbody Daypack Satchel for Hiking Hunting Trekking Fishing OEKO-TEX STANDARD 100

(12,790)
$33.99
FREE delivery Thu, Jun 19 on your first order