Skip to main content

CityLayout

Struct CityLayout 

Source
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

Source

pub fn new(root: &Path) -> Self

The layout of the city rooted at root.

Source

pub fn root(&self) -> &Path

The city root this layout derives from.

Source

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.

Source

pub fn ledger(&self) -> PathBuf

The whole city’s history.

Source

pub fn snapshot(&self) -> PathBuf

The snapshot a start resumes the views from.

Source

pub fn cas(&self) -> PathBuf

The whole city’s object store.

Source

pub fn library(&self) -> PathBuf

The city’s shelves of skills.

Source

pub fn config(&self, addr: &Address) -> PathBuf

The configuration layer a scope declares.

Source

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.

Source

pub fn city_filters(&self) -> PathBuf

What the city as a whole keeps out of what it sends a model.

Source

pub fn building_skills(&self, addr: &Address) -> PathBuf

A building’s own shelf of skills.

Source

pub fn filters(&self, addr: &Address) -> PathBuf

What a scope keeps out of what it sends a model.

Source

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.

Source

pub fn job(&self, addr: &Address) -> PathBuf

The task written for the session run at this address.

Source

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.

Source

pub fn urbanite(&self, addr: &Address) -> PathBuf

Who the standing resident at this address is.

Source

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.

Source

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).

Source

pub fn browsers(&self) -> PathBuf

The browsers paired at this machine’s own door, kept as public keys (crates/wire/spec/Server.lean §8-93).

Under the city’s reserved subtree for the reason Self::devices is: the table decides who may reach the city.

Source

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.

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for CityLayout

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CityLayout

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for CityLayout

Source§

impl Hash for CityLayout

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for CityLayout

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for CityLayout

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for CityLayout

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for CityLayout

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.