#traits
7 articles about traits
Filter by topic
Blanket implementations: one impl for every type that qualifies
Employing blanket implementations in Rust to minimize code duplication for maintainable libraries
Associated types vs. generics in a low-level I/O driver API
Utilizing associated types in Rust traits to design flexible, type-safe APIs for low-level I/O drivers and comparing advantages over generic type parameters
?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
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
Making Traits Object-Safe for Rust's dyn Trait in Plugin Systems
Understanding object safety in Rust and refactoring traits for dynamic dispatch
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.
Rust Traits vs. Java/C# Interfaces: Shared Behavior Done Right
Discussion on Rust traits vs Java/C# interfaces, covering dispatch mechanisms, compile-time behavior, and performance optimizations.