
Rust Trait Explorer
- 750 installs
- 1.3k repo stars
- Updated May 24, 2026
- zhanghandong/rust-skills
This is a copy of rust-trait-explorer by actionbook - installs and ranking accrue to the original listing.
rust-trait-explorer is a Claude Code skill that maps which Rust structs implement a given trait or which traits a struct satisfies using LSP go-to-implementation, for developers who need to navigate polymorphic designs w
About
rust-trait-explorer is a Rust code navigation skill from zhanghandong/rust-skills that uses LSP go-to-implementation alongside Read, Glob, and Grep to discover trait relationships in a codebase. Invoked via /rust-trait-explorer with a trait or struct name, the skill finds all implementors of a trait like Handler or lists every trait a struct satisfies. Developers reach for rust-trait-explorer when exploring generic bounds, debugging trait object hierarchies, or onboarding to an unfamiliar Rust service. The skill triggers on commands like find implementations, who implements, and bilingual queries for trait implementation discovery.
- Triggers on /trait-impl, find implementations, who implements, trait 实现, 谁实现了, 实现了哪些trait
- Combines LSP goToImplementation with Grep for impl * for Type patterns
- Generates an implementation map showing polymorphic relationships
- Supports both directions: Trait → all implementors and Type → all traits it implements
- Works on any Rust codebase with LSP support
Rust Trait Explorer by the numbers
- 750 all-time installs (skills.sh)
- +9 installs in the week ending Jul 28, 2026 (Skillselion tracking)
- Security screen: LOW risk (skills.sh audit)
- Data as of Jul 28, 2026 (Skillselion catalog sync)
npx skills add https://github.com/zhanghandong/rust-skills --skill rust-trait-explorerAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 750 |
|---|---|
| repo stars | ★ 1.3k |
| Security audit | 3 / 3 scanners passed |
| Last updated | May 24, 2026 |
| Repository | zhanghandong/rust-skills ↗ |
How do you find all Rust trait implementations?
Instantly map which structs implement a Rust trait or which traits a struct satisfies without manually grepping the entire codebase.
Who is it for?
Rust developers exploring polymorphic trait hierarchies in an unfamiliar or large codebase who want LSP-accurate results instead of fragile text grepping.
Skip if: Non-Rust projects, compile-error diagnostics, or developers who only need a single known implementation location.
When should I use this skill?
User asks who implements a trait, what traits a struct satisfies, or triggers /trait-impl or trait implementation discovery in Rust code.
What you get
Trait-to-struct implementation maps and struct-to-trait satisfaction lists from LSP analysis.
- trait implementation maps
- struct trait satisfaction lists
Files
Rust Trait Explorer
Discover trait implementations and understand polymorphic designs.
Usage
/rust-trait-explorer <TraitName|StructName>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.
LSP(
operation: "goToImplementation",
filePath: "src/traits.rs",
line: 10,
character: 11
)Use when:
- Trait name is known
- Want to find all implementors
- Understanding polymorphic code
Workflow
Find Trait Implementors
User: "Who implements the Handler trait?"
│
▼
[1] Find trait definition
LSP(goToDefinition) or workspaceSymbol
│
▼
[2] Get implementations
LSP(goToImplementation)
│
▼
[3] For each impl, get details
LSP(documentSymbol) for methods
│
▼
[4] Generate implementation mapFind Traits for a Type
User: "What traits does MyStruct implement?"
│
▼
[1] Find struct definition
│
▼
[2] Search for "impl * for MyStruct"
Grep pattern matching
│
▼
[3] Get trait details for each
│
▼
[4] Generate trait listOutput Format
Trait Implementors
## Implementations of `Handler`
**Trait defined at:** src/traits.rs:15
```rust
pub trait Handler {
fn handle(&self, request: Request) -> Response;
fn name(&self) -> &str;
}
```
### Implementors (4)
| Type | Location | Notes |
|------|----------|-------|
| AuthHandler | src/handlers/auth.rs:20 | Handles authentication |
| ApiHandler | src/handlers/api.rs:15 | REST API endpoints |
| WebSocketHandler | src/handlers/ws.rs:10 | WebSocket connections |
| MockHandler | tests/mocks.rs:5 | Test mock |
### Implementation Details
#### AuthHandler
```rust
impl Handler for AuthHandler {
fn handle(&self, request: Request) -> Response {
// Authentication logic
}
fn name(&self) -> &str {
"auth"
}
}
```
#### ApiHandler
```rust
impl Handler for ApiHandler {
fn handle(&self, request: Request) -> Response {
// API routing logic
}
fn name(&self) -> &str {
"api"
}
}
```Traits for a Type
## Traits implemented by `User`
**Struct defined at:** src/models/user.rs:10
### Standard Library Traits
| Trait | Derived/Manual | Notes |
|-------|----------------|-------|
| Debug | #[derive] | Auto-generated |
| Clone | #[derive] | Auto-generated |
| Default | manual | Custom defaults |
| Display | manual | User-friendly output |
### Serde Traits
| Trait | Location |
|-------|----------|
| Serialize | #[derive] |
| Deserialize | #[derive] |
### Project Traits
| Trait | Location | Methods |
|-------|----------|---------|
| Entity | src/db/entity.rs:30 | id(), created_at() |
| Validatable | src/validation.rs:15 | validate() |
### Implementation Hierarchy
```
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
## Trait Hierarchy
┌─────────────┐
│ Error │ (std)
└──────┬──────┘
│
┌────────────┼────────────┐
│ │ │
┌───────▼───────┐ ┌──▼──┐ ┌───────▼───────┐
│ AppError │ │ ... │ │ DbError │
└───────┬───────┘ └─────┘ └───────┬───────┘
│ │
┌───────▼───────┐ ┌───────▼───────┐
│ AuthError │ │ QueryError │
└───────────────┘ └───────────────┘Analysis Features
Coverage Check
## Trait Implementation Coverage
Trait: Handler (3 required methods)
| Implementor | handle() | name() | priority() | Complete |
|-------------|----------|--------|------------|----------|
| AuthHandler | ✅ | ✅ | ✅ | Yes |
| ApiHandler | ✅ | ✅ | ❌ default | Yes |
| MockHandler | ✅ | ✅ | ✅ | Yes |Blanket Implementations
## Blanket Implementations
The following blanket impls may apply to your types:
| Trait | Blanket Impl | Applies To |
|-------|--------------|------------|
| From<T> | `impl<T> From<T> for T` | All types |
| Into<U> | `impl<T, U> Into<U> for T where U: From<T>` | Types with From |
| ToString | `impl<T: Display> ToString for T` | Types with Display |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 |
Related skills
How it compares
Choose rust-trait-explorer over plain Grep when trait impls span modules and LSP-accurate resolution is needed for generic or dyn Trait patterns.
FAQ
How does rust-trait-explorer find implementations?
rust-trait-explorer uses LSP go-to-implementation operations to locate trait implementors and struct trait satisfaction lists. The skill supplements LSP results with Read, Glob, and Grep for comprehensive coverage across the Rust codebase.
What is the rust-trait-explorer command syntax?
rust-trait-explorer is invoked as /rust-trait-explorer followed by a trait or struct name. For example, /rust-trait-explorer Handler finds all structs implementing Handler, while /rust-trait-explorer MyStruct lists every trait MyStruct satisfies.
Is Rust Trait Explorer safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.