Registry / build-tool / cargo-metadata

cargo-metadata

JSON →
library0.23.1rscratesunverified

Provides structured access to the output of `cargo metadata`.

# Cargo.toml [dependencies] cargo_metadata = "0.23.1"
INSTALL
IMPORT
SIG · CARGO-METADATA
C
cargo-metadata
build-toolrustv0.23.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MetadataCommand
use cargo_metadata::MetadataCommand;

Executes `cargo metadata` and parses the output.

use cargo_metadata::MetadataCommand; fn main() -> Result<(), Box<dyn std::error::Error>> { let metadata = MetadataCommand::new().exec()?; println!("Workspace root: {:?}", metadata.workspace_root); Ok(()) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.23.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
26 hits · last 30 days
node
22
OpenAI (training)
1
Resources
cargo-metadata — cargo add cargo-metadata · libregistry