Skip to main content

Crate ryo_symbol

Crate ryo_symbol 

Source
Expand description

§ryo-symbol

Symbol system for Rust codebase - unique identifiers and file path management.

§Overview

This crate provides:

  • SymbolPath: Rust ecosystem-wide unique symbol identifier (tokio::sync::Mutex::lock)
  • SymbolId: High-performance internal ID (SlotMap-based, O(1) operations)
  • SymbolRegistry: Central registry for symbol management
  • WorkspaceFilePath: Self-contained file path with workspace root
  • WorkspacePathResolver: Path normalization and validation

§Design Philosophy

  • Two-layer architecture: SymbolPath (external) ↔ SymbolId (internal)
  • Single source of truth: All symbol operations go through SymbolRegistry
  • Self-contained paths: WorkspaceFilePath can resolve to absolute path without external context

§New in this version

  • ContentCache: File freshness tracking (hash/mtime)
  • SymbolPath: Added from_workspace_file, item_in_file, nested_in_file methods
  • FilePathResolver: SymbolPath → WorkspaceFilePath conversion

Re-exports§

pub use serde;
pub use slotmap;

Structs§

CacheEntry
Cache entry for a single file
CargoMetadataProvider
Cargo metadata based workspace provider
ContentCache
Content cache for tracking file freshness
CrateInfo
Information about a crate in the workspace
CrateName
Crate name from Cargo.toml
FilePathResolver
Resolves symbol paths to file paths
FileSpan
Position information within a file
ImportMap
Per-module import mapping
InvalidSymbolId
Invalid SymbolId error
MemoryStats
Memory usage statistics
ReExportInfo
Re-export information
Segment
Path segment
SymbolId
High-performance internal symbol ID
SymbolPath
Rust ecosystem-wide unique symbol path
SymbolPathBuilder
Builder for SymbolPath
SymbolPathResolver
Resolves WorkspaceFilePath to SymbolPath
SymbolRef
Unified symbol reference with ID and Path
SymbolRegistry
Central registry for symbol management
TargetInfo
Information about a cargo target (lib, bin, etc.)
UseResolver
Workspace-wide use resolver
Uuid
A Universally Unique Identifier (UUID).
WorkspaceFilePath
Normalized relative path from workspace root (self-contained)
WorkspacePathResolver
Workspace path resolver

Enums§

CrateLayout
Layout of a crate within a workspace
EntryPoint
Entry point type for a crate
Freshness
Freshness status for a file
InvalidCrateNameError
Invalid crate name error
MetadataError
Error type for CargoMetadataProvider
ParseError
SymbolPath parse error
RegistrationError
Symbol registration error
RenameError
Symbol rename error
ResolutionError
Path resolution error (for local paths like crate::, self::, super::)
ResolveError
WorkspacePathResolver error
SymbolKind
Symbol type classification
TargetKind
Kind of cargo target
UnregisterReexportError
Re-export unregistration error
VarScope
Variable scope type for InSymbol
Visibility
Visibility of a symbol
WorkspaceType
Type of workspace structure

Traits§

WorkspaceMetadataProvider
Workspace metadata provider trait

Functions§

write_with_parents
Write content to a file, creating parent directories if needed