ryo-symbol
Status: stable. Part of the ryo workspace — AST-centric Rust programming for AI agents.
Symbol system for Rust codebases: unique identifiers, file paths, and a central
registry. The two-layer design pairs SymbolPath (external, ecosystem-wide unique
like tokio::sync::Mutex::lock) with SymbolId (internal, SlotMap-backed for
O(1) ops). All operations go through SymbolRegistry as the single source of truth.
Install
Optional features: test-utils (extra TestHarness helpers), schemars
(JSON Schema derive).
Quickstart
use ;
let path = parse.unwrap;
let mut registry = new;
let id = registry.register.unwrap;
// Fast O(1) lookup
let resolved = registry.resolve;
assert!;
API Summary
| Type | Purpose |
|---|---|
SymbolPath |
Ecosystem-wide unique identifier (external) |
SymbolId |
Internal SlotMap key with generation counter |
SymbolRegistry |
Central registry for symbol lifecycle |
WorkspaceFilePath |
Self-contained file path with workspace root |
WorkspacePathResolver |
Path normalization / validation |
ContentCache |
File freshness tracking (hash / mtime) |
See the crate docs for the full module index.
Status
API surface considered stable for the v0.1.0 release. New helpers
(from_workspace_file, item_in_file, nested_in_file) added in this version.
License
Licensed under either of Apache-2.0 or MIT at your option.