m04-zero-cost - Zero-cost abstraction in Rust generics and traits
Choose between compile-time and runtime polymorphism using generics and trait objects
Tags
Updated: 2026-03-10Capabilities
Typical Inputs
Typical Outputs
What this skill does
- analyze error codes
- choose polymorphism type
- determine dispatch method
- design trait abstraction
- compare performance trade-offs
- apply static dispatch
- apply dynamic dispatch
- check object safety
- resolve type errors
- select code pattern
Inputs
- compile-time type information
- runtime type information
- performance priority
- error code (E0277, E0308, E0599)
- type requirements
Outputs
- static dispatch implementation
- dynamic dispatch implementation
- trait abstraction design
- code pattern recommendation
- error resolution
- polymorphism strategy
Requirements
- Rust compiler
- type error diagnosis
