rmc-method-api

Identify used and dead methods in a Rust type's public API.

29|5|Updated Nov 24, 2025
One-click install
npx skills add https://github.com/molaco/rust-code-mcp --skill rmc-method-api
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rmc-method-api
Source: https://github.com/molaco/rust-code-mcp/tree/main/skills/rmc-method-api
Command: npx skills add https://github.com/molaco/rust-code-mcp --skill rmc-method-api

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps you identify which methods on a specific Rust type are actually used in the codebase, including dead APIs, test-only helpers, and naming inconsistencies.

Core Features & Use Cases

  • Method-surface inventory: Pulls a single type’s complete method API surface (methods, associated consts, and associated types) using the Layer-4 module tree.
  • Fan-in analysis: Computes per-method usage fan-in via who_uses_summary, enabling you to rank critical entry points and detect unused methods.
  • Inherent vs trait dispatch clarity: Helps distinguish inherent methods from trait/impl dispatch patterns so you can reason about how callers reach the API.
  • Practical outputs for review: Produces summaries listing dead methods and top-by-fan-in methods to drive refactors and API cleanup.

Quick Start

Run the skill to build the hypergraph for your workspace, generate the depth-4 module tree for your target crate and type, then rank each method by who_uses_summary fan-in to produce a dead-method list and top callers.

Frequently Asked Questions about rmc-method-api

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

FAQPage Schema
How do I find unused methods and dead code in a Rust codebase?

To find dead code in a Rust codebase, you can audit a specific type's public API surface to enumerate all methods and associated items, then compute per-method usage fan-in to flag any methods with zero call sites as dead code.

How do I check which methods on a Rust type are actually called?

Checking Rust method usage involves running a fan-in analysis that summarizes who-uses data per method, ranking critical entry points by call-site count and distinguishing inherent methods from trait dispatch patterns.

What is the best way to audit a Rust type's public API surface for refactoring?

Auditing a Rust type's public API surface for refactoring involves building a workspace hypergraph, generating a depth-4 module tree for the target type, and producing a dead-method list alongside top callers to prioritize cleanup.

Can I detect test-only helper methods in a Rust workspace?

Yes, detecting test-only helper methods in a Rust workspace is possible by computing per-method usage fan-in across the codebase, which flags methods that are only referenced within test modules and not used in production code.

How do I distinguish inherent methods from trait dispatch in Rust call sites?

Distinguishing inherent methods from trait dispatch in Rust requires analyzing call-site patterns across the workspace hypergraph to reason about how callers reach the API through impl blocks versus trait resolution.

Does this Rust method audit work across an entire workspace or just a single crate?

The Rust method audit works across the entire workspace by building a workspace-level hypergraph, but the method-surface inventory and fan-in analysis target a single type within a specific crate to produce focused dead-code and refactoring summaries.