
de rust-skills1,013
Guidance for choosing between generics and trait objects in Rust, with patterns for zero-cost abstractions and troubleshooting common compiler errors.
Provides compact, expertise-driven guidance on when to use generics (static dispatch) versus trait objects (dynamic dispatch) in Rust. It frames compiler errors (E0277, E0308, E0599, E0038) as design questions, offers decision heuristics, quick reference tables, and anti-patterns to avoid excessive generics or inappropriate dynamic dispatch.
Use when facing Rust type-system design choices: performance-sensitive code needing zero runtime cost, heterogeneous collections, plugin architectures, or when resolving trait/object-safety compiler errors during development and code review. It’s aimed at Rust developers and tools that assist with compiler diagnostics.
Best used by coding assistants and CLI agents such as Codex CLI, Cursor, Claude Code, and other developer-focused agents able to read code and suggest refactors.
Cette compétence n'a pas encore été examinée par notre pipeline d'audit automatisé.