Rust Concepts: dyn Trait, Custom Iterators, Deref/Drop & Axum REST API (Part 5)
This article is the fifth part of a series on core Rust concepts, focusing on advanced topics such as dynamic dispatch and custom iterators. It explains the differences between static and dynamic dispatch using trait objects, as well as the implementation of the Deref and Drop traits. Additionally, the article covers building a REST API with the Axum framework.
- ▪The article is part of a series on core Rust concepts, with previous parts covering various advanced topics.
- ▪It discusses the use of dyn Trait for dynamic dispatch and its advantages over static dispatch.
- ▪The article also introduces the Deref trait and its role in Rust's type system.
Opening excerpt (first ~120 words) tap to expand
try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 3937603) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } mihir mohapatra Posted on May 22 Rust Concepts: dyn Trait, Custom Iterators, Deref/Drop & Axum REST API (Part 5) #rust #webdev #intermediate #systems Core Rust Concepts (4 Part Series) 1 Advanced Rust Concepts: Iterators, Closures, Generics & More (Part 2) 2 Rust Concepts: Macros, Modules, Testing & Unsafe Rust (Part 3) 3 Rust Concurrency: Threads, Channels, Mutex & Sync (Part 4) 4 Rust Concepts: dyn Trait, Custom Iterators, Deref/Drop & Axum REST API (Part 5) This is Part 5 of the…
Excerpt limited to ~120 words for fair-use compliance. The full article is at DEV.to (Top).