| Crates.io | workspacer-register |
| lib.rs | workspacer-register |
| version | 0.1.3 |
| created_at | 2025-04-01 20:54:20.65731+00 |
| updated_at | 2025-07-13 04:07:02.97765+00 |
| description | Utility crate to ensure all source files are registered within a workspace, managing macro definitions and integration for seamless Rust project maintenance. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1615536 |
| size | 344,476 |
The workspacer-register crate is a comprehensive utility designed to ensure the registration of source files within a workspace, with specific focus on managing macro definitions and their seamless integration. Predominantly, it handles macros defined in the x! form, incorporating functionalities for deduplicating, assembling, and inserting macro blocks into source files efficiently.
This crate offers several essential features:
SourceFile structures, specifically engineered to manage x! macros.Macro Processing and Management:
TopBlockMacro and ExistingXMacro: Structs to encapsulate macro data with leading comments and range information.build_top_block_for_no_imports_line, handling complex assembly of macro snippets based on context and order.Async File Registration:
EnsureAllSourceFilesAreRegistered enables concurrent operations over workspace crates, ensuring that source files are duly updated.Efficient Code Integration:
filter_new_macros_for_duplicates, preventing macro replication.ra_ap_syntax to parse and manipulate Rust source files with precise syntactic transformations.To utilize workspacer-register, include it in your Cargo.toml and implement the required traits in your workspace's custom logic. Leverage the provided utility functions to integrate and manage macros seamlessly across your project files.
use workspacer_register::{EnsureAllSourceFilesAreRegistered, Workspace};
#[tokio::main]
async fn main() {
let workspace = Workspace::new();
workspace.ensure_all_source_files_are_registered().await.unwrap();
}
This example demonstrates the initialization of the workspace and the invocation of the macro registration mechanism to enforce uniformity and completeness across source files.
This project is licensed under the MIT License - see the LICENSE file for details.