#validation #semver

workspacer-toml

Efficiently manage and validate Cargo.toml files with field verification and asynchronous operations

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

Download history 182/week @ 2025-10-27 220/week @ 2025-11-03 204/week @ 2025-11-10 245/week @ 2025-11-17 181/week @ 2025-11-24 274/week @ 2025-12-01 146/week @ 2025-12-08 198/week @ 2025-12-15 240/week @ 2025-12-22 197/week @ 2025-12-29 159/week @ 2026-01-05 74/week @ 2026-01-12 237/week @ 2026-01-19 236/week @ 2026-01-26 243/week @ 2026-02-02 119/week @ 2026-02-09

835 downloads per month
Used in 78 crates (10 directly)

MIT/Apache

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 tokio for non-blocking file operations on Cargo.toml, enhancing performance in concurrent environments.
  • Field Manipulation: Easily retrieve and update fields like version, license, authors, and repository using 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.toml file 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

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