| Crates.io | workspacer-check-crates-io |
| lib.rs | workspacer-check-crates-io |
| version | 0.1.3 |
| created_at | 2025-04-01 06:52:29.89309+00 |
| updated_at | 2025-07-13 00:54:52.148074+00 |
| description | An asynchronous Rust crate offering verification of crate version publish status on crates.io, enhancing automated release workflows. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1614471 |
| size | 158,064 |
workspacer-check-crates-io is a Rust crate that provides an asynchronous interface for verifying the publish status of a specific crate version on crates.io. This functionality is crucial for developers seeking to automate the release process while ensuring version uniqueness within the crates.io ecosystem.
VerifyCrateVersionIsNotYetPublishedOnCratesIo trait, offering an easy-to-use method to check if a crate version is already published.WorkspaceError to CrateError, ensuring clear diagnostics should issues arise.Implement the VerifyCrateVersionIsNotYetPublishedOnCratesIo for your crate handle to leverage its capabilities:
#[async_trait]
impl VerifyCrateVersionIsNotYetPublishedOnCratesIo for CrateHandle {
type Error = CrateError;
async fn verify_crate_version_is_not_yet_published_on_crates_io(&self) -> Result<(), Self::Error> {
// Implementation...
}
}
Extract the utility function to directly query if a certain version is published:
pub async fn is_crate_version_published_on_crates_io(crate_name: &str, crate_version: &semver::Version) -> Result<bool, WorkspaceError> {
let url = format!("https://crates.io/api/v1/crates/{}/{}", crate_name, crate_version);
// Make the HTTP request and handle the result...
}
reqwest for HTTP requests and async_trait for trait convenience.Ensure that your project is configured with the Rust 2024 edition for compatibility.
To install this crate, add it to your Cargo.toml dependencies:
dependencies = [
"workspacer-check-crates-io = \"0.1.0\""
]
To utilize the functionalities, implement the trait as described and invoke the check function where needed.
This project is licensed under the MIT License. For more details, see the LICENSE file.