For context, I currently have a number of crates that make up the iocaine project:
iocaine-recipeis the configuration loader, config structures, and KDL helpers.iocaine-powderare the matchers, generators, and the scripting engines. It sits atopiocaine-recipe.iocaine-vialcontains the various servers (http-server,haproxy-spoa-server, and soon,prometheus-server), along with implementingiocaine-powder's HTTP type traits forhttp::Requestandhttp::Response. It sits atopiocaine-powderiocaine-challengeimplements the various command-line command handlers: this has an implementation foriocaine start,iocaine validate-configuration,iocaine runtime decide,iocaine runtime output, andiocaine self-test. It sits atopiocaine-vial.iocaine-tableis the firewall implementation, and is currently unused. It will be used by the script engine implementations.iocainethe main CLI crate, a thin wrapper aroundiocaine-challenge.
Now, I have a problem. I have another project - a spam filter - that could use the same matchers I have implemented for iocaine. There's absolutely no point in reimplementing them again. Technically, I could pull in iocaine-powder, with default features disabled, and only the matchers enabled, and that'd do the trick, but then I'd have access to the matchers, but not to their roto bindings (my spam filter uses Roto too).
So I'm thinking about how to handle the situation. I can either restructure iocaine-powder, and move the roto/lua bindings out of the script engine implementation, so I can do features = ["all-matchers", "language-roto"] and have access to both the types and their roto bindings.
Or, I can move those to a whole separate crate, so that iocaine-powder has the engine trait & impl, but another crate has the matchers, perhaps another the generators, with roto & lua bindings in their matcher/generator crates.
Keeping it all in one crate means it's all neatly in one place. Splitting it up means that third parties that only need parts of it have less dependencies to deal with (I mean, they end up with the same practical dependencies, as the unnecessary ones can be disabled via cargo features - but they'll still be there as "optional" deps).
So now I'm wondering what to do. Do I split the crate? If so, how granular do I go? Do I split matchers and generators into their separate crates? Or do I split matchers + generators in one crate, and keep the script engine stuff in iocaine-powder?
And if I split, what even is the point of iocaine-powder? It'd be a very thin layer over the SexDungeon trait (declared within the very same crate) that binds that, the recipes, and the matchers / generators together, along with some very iocaine specific stuff that doesn't fit elsewhere.
Decisions, decisions.
Hrmpf. I may need to rearrange the score summary type. It currently doesn't tell me which check contributed how much score, and that's annoying. Nor does it tell me which comment belongs to which.
...but then it's not much than a wrapper over the source type with the total score attached, and the "extract these parts of the request" list collapsed into unique parts.