ryo-metadata 0.1.0

Cargo workspace and crate metadata resolution for ryo
Documentation

ryo-metadata

crates.io docs.rs License: MIT OR Apache-2.0

Status: stable. Part of the ryo workspace — AST-centric Rust programming for AI agents.

Cargo workspace and crate metadata resolution for ryo. Solves the crate:: vs actual-crate-name problem by walking cargo metadata, mapping file paths to crate names, and producing accurate SymbolPaths.

Install

cargo add ryo-metadata

Quickstart

use ryo_metadata::WorkspaceResolver;

let resolver = WorkspaceResolver::from_manifest("Cargo.toml")?;

let crate_name = resolver.crate_for_file("crates/ryo-app/src/lib.rs");
assert_eq!(crate_name, Some("ryo_app"));

for member in resolver.members() {
    println!("{}: {}", member.name, member.manifest_path);
}

API Summary

Type Purpose
WorkspaceResolver Discover workspace members and map file paths to crates
CrateInfo Single crate metadata entry
ResolvedCrateName Resolved internal-name / display-name pair
ResolvedFile / ResolvedModulePath File and module path resolutions
MetadataError Error type for resolution failures

cargo_metadata::{Metadata, MetadataCommand, Package} is re-exported for downstream convenience.

Status

API surface considered stable for the v0.1.0 release.

License

Licensed under either of Apache-2.0 or MIT at your option.