pub struct CityLayout { /* private fields */ }Expand description
The disk layout of one city, derived from its root.
Construct it once per city root and ask it for paths; the segments are never joined by hand at a call site.
Implementations§
Source§impl CityLayout
impl CityLayout
Sourcepub fn scope(&self, addr: &Address) -> PathBuf
pub fn scope(&self, addr: &Address) -> PathBuf
The directory an address names: the city root with the address’s segments below it.
Segment by segment rather than one joined string, because a city served on Windows and a city served on Linux must lay the same address down as the same directory.
Sourcepub fn city_config(&self) -> PathBuf
pub fn city_config(&self) -> PathBuf
The configuration layer the city itself declares.
The same rule as config at the root, and a
method of its own because the root is not an address, and a
caller without one would otherwise join the two names by hand.
Sourcepub fn city_filters(&self) -> PathBuf
pub fn city_filters(&self) -> PathBuf
What the city as a whole keeps out of what it sends a model.
Sourcepub fn building_skills(&self, addr: &Address) -> PathBuf
pub fn building_skills(&self, addr: &Address) -> PathBuf
A building’s own shelf of skills.
Sourcepub fn filters(&self, addr: &Address) -> PathBuf
pub fn filters(&self, addr: &Address) -> PathBuf
What a scope keeps out of what it sends a model.
Sourcepub fn archive(&self, building: &Address) -> PathBuf
pub fn archive(&self, building: &Address) -> PathBuf
Where a building files finished work.
In the open rather than under the reserved subtree: residents write these documents and read them back.
Sourcepub fn job(&self, addr: &Address) -> PathBuf
pub fn job(&self, addr: &Address) -> PathBuf
The task written for the session run at this address.
Sourcepub fn handoff(&self, room: &Address) -> PathBuf
pub fn handoff(&self, room: &Address) -> PathBuf
What one room hands to whoever picks it up next.
The room’s rather than the building’s: two sessions of one building can freeze at once, and one file for both would be two contents fighting over one name.
Sourcepub fn urbanite(&self, addr: &Address) -> PathBuf
pub fn urbanite(&self, addr: &Address) -> PathBuf
Who the standing resident at this address is.
Sourcepub fn guide(&self) -> PathBuf
pub fn guide(&self) -> PathBuf
How far the person has got through this city’s first-run guide
(crates/wire/Spec.lean §8-68).
Under the city’s reserved subtree, because it decides what this city shows a person when it opens, and no write domain reaches it.
Sourcepub fn devices(&self) -> PathBuf
pub fn devices(&self) -> PathBuf
The devices paired to reach this city from outside the machine.
Under the city’s reserved subtree, because the table decides who
may reach the city and no write domain may change that
(crates/kernel/spec/Layout.lean §8-76).
Sourcepub fn playback_exports(&self) -> PathBuf
pub fn playback_exports(&self) -> PathBuf
Where residents’ playback exports land, one directory per
building (crates/accounting/Spec.lean §8-13, crates/sprawling/Spec.lean §8-132).
Under the city’s reserved subtree, because no write domain reaches
it, so a written report is changed only by exporting another; the
city root’s .gitignore keeps it out of history; and no worktree
holds it, so sweeping one loses no report.
Sourcepub fn monitor(&self) -> PathBuf
pub fn monitor(&self) -> PathBuf
Where this city remembers its monitor’s sampling beat: a setting of how this machine measures, which no write domain reaches.
Sourcepub fn of_ledger(dir: &Path) -> Option<CityLayout>
pub fn of_ledger(dir: &Path) -> Option<CityLayout>
The layout whose ledger is dir, when dir is a city’s.
The inverse of ledger, for the writer that is
handed the ledger directory and must find the root every other
path is derived from. None for a directory that is not a ledger
under a reserved prefix: a fixture, a bundle being verified, or a
store somebody opened directly, none of which is a city.
Sourcepub fn city_address(&self) -> Option<Address>
pub fn city_address(&self) -> Option<Address>
The city’s own name, read from the directory it lives in.
The one address that names the city rather than a room: the genesis record carries it so a city can say who it is, and the session projection must file it nowhere, because no building is named after the city inside itself. Not every directory name is an address - a path can hold characters an address may not - and a city whose directory cannot be spelled as an address simply has no name to show, which is honest and rare.