Skip to content

Instantly share code, notes, and snippets.

@Houtamelo
Houtamelo / lesson_deref.md
Last active October 16, 2024 05:23
Lesson - Deref

Introduction

This lesson aims to teach the reader about the inner-workings of Rust's *(deref operator) and trait Deref, as well as how to take advantage of those features.

Requirements

This lesson assumes that:

  • You have amateurish understanding of Rust's type system. Most importantly, understand that references are types, meaning &T, &mut T and T are all different types.

Terminology