rust-trait-explorer

Explore Rust trait implementations and type-trait relationships via LSP searches.

51|6|Updated Mar 28, 2019
One-click install
npx skills add https://github.com/Mte90/dotfiles --skill rust-trait-explorer-mte90
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-trait-explorer
Source: https://github.com/Mte90/dotfiles/tree/main/.config/opencode/skills/rust-trait-explorer
Command: npx skills add https://github.com/Mte90/dotfiles --skill rust-trait-explorer-mte90

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps developers understand Rust's trait system by allowing them to discover trait implementations for types and identify traits implemented by specific types.

Core Features & Use Cases

  • Find Implementors: Discover all types that implement a given trait.
  • Find Implemented Traits: List all traits implemented by a specific type.
  • Code Navigation: Integrates with LSP for precise definition and implementation lookups.
  • Use Case: When refactoring or understanding a complex Rust codebase, quickly find all the places a specific trait is used or which traits a particular struct adheres to.

Quick Start

Find all implementations of the Handler trait in the current Rust project.

Frequently Asked Questions about rust-trait-explorer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find all implementors of a trait in a Rust project?

You can find all implementors of a Rust trait by using LSP queries and workspace symbol searches to locate every type implementing that specific trait within your project.

How do I list all traits implemented by a specific Rust struct?

You list all traits implemented by a specific Rust type by querying type-trait relationships through LSP to identify every trait that the struct adheres to.

What is the best way to navigate polymorphic designs in a Rust codebase?

Navigating polymorphic designs in a Rust codebase is best achieved by exploring trait implementations and type-trait relationships through LSP to facilitate precise code navigation and understanding of complex structures.

Does this trait exploration approach require a Language Server Protocol setup?

Yes, exploring Rust trait implementations requires a Language Server Protocol setup because it relies on LSP integration for precise definition lookups and identifying type-trait relationships within the workspace.

Why use LSP for Rust code navigation instead of standard text search?

Using LSP for Rust code navigation provides precise definition and implementation lookups for traits and types, whereas standard text search lacks the semantic understanding needed to accurately map polymorphic designs and type-trait relationships.