| Crates.io | workspacer-lock |
| lib.rs | workspacer-lock |
| version | 0.1.2 |
| created_at | 2025-04-01 15:54:45.804151+00 |
| updated_at | 2025-07-13 01:20:10.565683+00 |
| description | Asynchronously reads `Cargo.lock` to map crates to versions, supporting dependency management in Rust projects with detailed error handling. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1615025 |
| size | 151,357 |
workspacer-lock is a Rust crate designed to facilitate the extraction and mapping of crate version data from a Cargo.lock file, a critical component within a Rust project for managing dependency versions. This crate provides an asynchronous function, build_lock_versions, that efficiently reads and interprets the Cargo.lock file from a designated root directory and constructs a comprehensive map of crate names to their respective version sets.
Cargo.lock file.BTreeMap and BTreeSet for efficient storage and retrieval of crate-version mappings, preserving order and uniqueness.To use workspacer-lock in your project:
use workspacer_lock::build_lock_versions;
use std::path::Path;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let root = Path::new("/path/to/project");
let version_map = build_lock_versions(&root).await?;
for (crate_name, versions) in version_map {
println!("{}: {:?}", crate_name, versions);
}
Ok(())
}
This crate is compliant with the Rust 2024 edition, ensuring compatibility with the latest language features and improvements.
Contributions are welcome. Please adhere to the project's coding standards and ensure tests are included for new features or bug fixes.
workspacer-lock is distributed under the MIT License. See LICENSE for more information.