-
Notifications
You must be signed in to change notification settings - Fork 5
Feat: Sets Spread Across An Entire Crate #17
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Some users may find it useful to allow sets to be spread across the entire crate. Due to the way Rust works this is not possible without a different approach.
Proposal
- Add a feature flag -
code_gen. This flag will enable anerror_set_part!macro. - Create a build runner to run in
build.rsthat scans all files forerror_set_part!definitions and combines all definitions in a file likeerror_set.rswith a singleerror_set!macro. - Since
error_set_part!can know the name of each error type it needs and the output location is constant, it can evaluate to import the correct enums from this file. e.g.
error_set_part! {
Error1 = ...
Error2 = ...
}->
use crate::error_set::Error1;
use crate::error_set::Error2;Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request