rust-trait-explorer

Explore Rust trait implementations using LSP. Triggers on: /trait-impl, find implementations, who implements, trait 实现, 谁实现了, 实现了哪些trait

By actionbook · 2,673 installs

npx skills add actionbook/rust-skills --skill rust-trait-explorer

Source repository · Upstream listing

Rust Trait Explorer Discover trait implementations and understand polymorphic designs. Usage Examples: /rust trait explorer Handler Find all implementors of Handler trait /rust trait explorer MyStruct Find all traits implemented by MyStruct LSP Operations Go to Implementation Find all implementations of a trait. Use when: Trait name is known Want to find all implementors Understanding polymorphic code Workflow Find Trait Implementors Find Traits for a Type Output Format Trait Implementors rust pub trait Handler { fn handle(&self, request: Request) Response; fn name(&self) &str; } ​ rust impl Handler for AuthHandler { fn handle(&self, request: Request) Response { // Authentication logic } fn name(&self) &str { "auth" } } ​ rust impl Handler for ApiHandler { fn handle(&self, request: Request) Response { // API routing logic } fn name(&self) &str { "api" } } ​ Traits for a Type User ├── derive │ ├── Debug │ ├── Clone │ ├── Serialize │ └── Deserialize └── impl ├── Default (src/models/user.rs:50) ├── Display (src/models/user.rs:60) ├── Entity (src/models/user.rs:70) └── Validatable (src/models/user.rs:85) ​ Trait Hierarchy Visualization Analysis Features Coverage Check Blanket Implementations Common Patterns User Says Action "Who implements X?" goToImplementation on trait "What traits does Y impl?" Grep for impl for Y "Show trait hierarchy" Find super traits recursively "Is X: Send + Sync?" Check std trait impls Related Skills When See Navigate to impl rust code navigator Call relationships rust call graph Project structure rust symbol analyzer Safe refactoring rust refactor helper