layered: move configuration into library component #781
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Move the LayerConfig and its children from
main.rs
intolib.rs
. This allowsother tooling, such as config managers or test executors, to modify layered
configs programmatically.
The end goal is to move everything in
layered
except for the argument parsinginto a
run_layered
function, but I haven't done it in this diff because it'sa larger change. This is a common pattern in Rust projects to do as little as
possible in
main.rs
for extensibility.The only change here, other than publicity and where things are located, is the
signature of
CpuPool::alloc_cpus
. It previously relied on&Layer
, and thischanges it to the two elements of
Layer
it uses. This allowsLayer
to stayconfined to
main.rs
(for now) to prevent scope creep in this PR.This may be inconvenient in the short term for WIPs and anyone doing non-Cargo
builds (cough me), but having things split into more files should make
rebases/merges easier in the long run.
Test plan:
cargo build --release