#generics
4 articles about generics
Filter by Topic
All#advanced#allocation#associated-types#beginners#blanket-implementations#borrowing#bounds#box#c#cache#closures#code-duplication#collections#concurrency#dangling-pointer#data-races#deadlock#dispatch#drain#drop#dynamic-dispatch#embedded#fnmut#gc#generics#heap#higher-order-functions#io-drivers#iterators#library-design#lifetimes#memory#monomorphization#object-safety#operators#optimization#ownership#performance#plugins#retain#rust#simd#sized#stack#str#string#supertraits#trait-bounds#trait-coherence#traits#type-safety#unsized#vec
rustAugust 15, 2025
Write a function that accepts both sized types (e.g., [u8; 16]) and unsized types (e.g., [u8] or dyn Trait) with ?Sized bound
Understanding the role of ?Sized bounds in Rust trait definitions and leveraging them to create flexible functions that work with both sized and unsized types efficiently
rustAugust 14, 2025
Use supertraits to enforce a hierarchy of behaviors
Leveraging supertraits to establish behavior hierarchies and combining them with where clauses to optimize complex generic algorithms for performance and type safety
rustAugust 12, 2025
fn process<T: MyTrait>(x: T)) VS using dyn MyTrait for dynamic dispatch.
Static vs. Dynamic Dispatch
rustAugust 11, 2025
Trait Bounds
Using trait bounds in Rust for type safety and performance in mathematical computations