7 releases (4 breaking)
Uses new Rust 2024
| 0.5.2 | Jul 13, 2025 |
|---|---|
| 0.5.1 | Apr 1, 2025 |
| 0.5.0 | Feb 21, 2025 |
| 0.4.0 | Feb 21, 2025 |
| 0.1.0 | Feb 9, 2025 |
#227 in #semver
835 downloads per month
Used in 78 crates
(10 directly)
275KB
2.5K
SLoC
workspacer-toml
workspacer-toml is a Rust crate designed to manage and validate Cargo.toml files efficiently. It provides an interface to manipulate, inspect, and ensure the integrity of essential fields required for Rust package publishing such as name, version, authors, and license.
Features
- Validation: Ensures that all mandatory fields are present and correctly formatted according to Semantic Versioning.
- Asynchronous Operations: Uses
tokiofor non-blocking file operations onCargo.toml, enhancing performance in concurrent environments. - Field Manipulation: Easily retrieve and update fields like
version,license,authors, andrepositoryusing provided trait implementations. - Integrity Checks: Verifies the presence of necessary fields, ensuring the file's compliance for both integrity and publishing standards.
Technical Insights
workspacer-toml employs serde for serialization and deserialization of TOML content, and uses toml_edit for precise document manipulation. This combination ensures robust parsing and serialization, minimizing errors during version control and dependency management.
Trait Implementations
- GetPackageAuthors: Retrieve the package's authors.
- CheckExistence: Confirm the existence and validity of the
Cargo.tomlfile path. - UpdateDependencyVersionRaw: Update the specified dependency version within the TOML.
License
Licensed under either of MIT License or Apache License, Version 2.0 at your option.
Repository
For access and contributions, visit the GitHub repository.
Authors
- Klebs - tpk3.mx@gmail.com
Usage
use workspacer_toml::CargoToml;
let cargo_toml = CargoToml::new("path/to/Cargo.toml").await.expect("Valid Cargo.toml required");
cargo_toml.validate_toml().expect("Validation failed");
Dependencies
~44–84MB
~1.5M SLoC