pub enum Settings {
Files(Files),
}Expand description
The layers this platform actually keeps, and where it keeps them.
One type rather than a trait object, because the two implementations are
the whole set. A platform keeps its policy in files or in a registry, this
enum is those two, and for_this_platform is the only thing that builds
one. A Box<dyn Source> would buy extensibility nobody wants and lose
locations, which is not on Source deliberately — reading a layer and
naming where it came from are different questions, and only the interface
asks the second.
Variants§
Implementations§
Source§impl Settings
impl Settings
Sourcepub fn locations(&self) -> Vec<(Origin, String)>
pub fn locations(&self) -> Vec<(Origin, String)>
Where this machine reads its layers from, most authoritative first, in whatever words a person would use to go and look.
A path on one platform and a key on another, so the answer is a string
rather than a Path: concept 10’s point is that only the running
program can say where its settings are, and a type that can only hold
filenames cannot say it on Windows.