analyze-rust-ffi-crate-surface

Map Rust FFI symbols to their C usage sites across the codebase.

6.2k|590|Updated May 5, 2016
One-click install
npx skills add https://github.com/RediSearch/RediSearch --skill analyze-rust-ffi-crate-surface
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: analyze-rust-ffi-crate-surface
Source: https://github.com/RediSearch/RediSearch/tree/main/.skills/analyze-rust-ffi-crate-surface
Command: npx skills add https://github.com/RediSearch/RediSearch --skill analyze-rust-ffi-crate-surface

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developers integrating Rust with C often struggle to identify which C-visible symbols are exposed via FFI, and where they are used across a large codebase.

Core Features & Use Cases

  • Symbol discovery: Enumerate all extern "C" symbols and types exposed by a Rust crate or file.
  • Usage mapping: Associate each symbol with the C modules that consume or reference it.
  • Cross-language traceability: Provide a clear map from Rust FFI symbols to their C usage context for safer maintenance and auditing.

Quick Start

Run the analysis against a Rust crate or a directory containing Rust sources to generate a usage report that links FFI symbols to their C call sites.

Frequently Asked Questions about analyze-rust-ffi-crate-surface

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

FAQPage Schema
How do I identify which C-visible symbols a Rust crate exposes via FFI?

FFI symbol discovery enumerates all extern "C" symbols and types defined in Rust source files that are visible to C code. Run the analysis against your Rust crate to automatically extract these symbols from source declarations and auto-generated headers in src/redisearch_rs/headers, producing a complete inventory.

Can I map Rust FFI symbols to where they're actually used in C code?

Usage mapping associates each FFI symbol with the C modules that consume it across your full codebase. The analysis cross-references Rust-exposed symbols against C call sites to produce a traceability report linking each symbol to its C usage context and call signatures.

What's the best way to audit Rust-C integration in a large codebase?

Cross-language traceability provides a clear map from all Rust FFI symbols to their C usage locations, enabling safer maintenance and auditing. Generate a usage report that documents symbol signatures, module dependencies, and consumption patterns across the integrated Rust and C layers.

Do I need to manually trace FFI symbols between Rust and C files?

No. The analysis automates symbol discovery and usage mapping by reading Rust sources, consulting generated headers, and cross-referencing the C codebase. This eliminates manual tracing and produces a complete, queryable report of all Rust-defined symbols and their C dependencies.

How do I ensure all Rust FFI exports are actually used in C?

Usage mapping identifies which C modules reference each FFI symbol, revealing unused or orphaned exports. By correlating Rust symbol definitions against C call sites in the full codebase, you detect dead FFI code and validate that exposure is intentional.