| Crates.io | workspacer-add-internal-dep |
| lib.rs | workspacer-add-internal-dep |
| version | 0.1.3 |
| created_at | 2025-04-01 04:52:25.453769+00 |
| updated_at | 2025-07-13 00:32:06.482459+00 |
| description | Facilitates adding internal dependencies between crates within a Cargo workspace asynchronously with `toml_edit` for robust dependency management. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1614405 |
| size | 165,521 |
A Rust crate that provides functionality to facilitate the addition of internal dependencies between crates within a Cargo workspace. This crate is especially tailored for developers who need to efficiently manage and automate dependency inclusion, ensuring that complex project structures with nested dependencies are correctly handled.
The primary composition of the crate revolves around the AddInternalDependency trait, designed to be implemented for a Workspace type. This allows users to manage dependencies dynamically in an asynchronous context. It utilizes toml_edit to modify the project's Cargo.toml file and handles potential I/O errors with precise error reporting, ensuring robust operational behavior.
The crate also updates the target crate's imports.rs file to propagate new dependencies, maintaining coherence across the workspace.
Add the following to your Cargo.toml:
[dependencies]
workspacer-add-internal-dep = "0.1.0"
use workspacer-add-internal-dep::AddInternalDependency;
// Assume Workspace and other structs are already defined
// let workspace: Workspace<_, _> = ...;
// workspace.add_internal_dependency(&target_crate, &dependency_crate).await.unwrap();
toml_edit for safe and concurrent manipulation of TOML files.Please consult the documentation for a complete guide on function signatures and error types.
Available under the MIT License. See the LICENSE file for more information.