#generics

4 articles about generics

rustAugust 15, 2025

?Sized: writing one function for both sized and unsized types

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

Supertraits: enforcing a hierarchy of behaviours

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

Trait bounds or dyn Trait? Static and dynamic dispatch compared

Generics with a trait bound compile to static dispatch; dyn Trait compiles to a vtable lookup. What each costs, and how to choose.

rustAugust 11, 2025

Trait Bounds

Using trait bounds in Rust for type safety and performance in mathematical computations