Skip to main content

Snapshot

Struct Snapshot 

Source
pub struct Snapshot {
Show 14 fields pub workspaces: Vec<Workspace>, pub projects: Vec<PathBuf>, pub trees: HashMap<PathBuf, GitTree>, pub bills: HashMap<PathBuf, Vec<StepBill>>, pub windows: BTreeMap<String, u64>, pub balls_by_project: HashMap<PathBuf, Vec<Ball>>, pub closed_by_project: HashMap<PathBuf, Vec<Ball>>, pub join_rows: Vec<JoinRow>, pub ops: Vec<OpRow>, pub growth: Vec<Growth>, pub ui_bytes: Option<Vec<u8>>, pub derived_at_unix: i64, pub cadence: Cadence, pub fleet: BTreeMap<String, Policy>,
}
Expand description

A completed derivation (§7.2). Cheap to hand out (Arc), never mutated.

Fields§

§workspaces: Vec<Workspace>

Every enumerated workspace, classified (§3.1).

§projects: Vec<PathBuf>

Every enumerated project’s decoded invocation path (§5.1 #1), internal clones included — the set the §11 roster labels and the boundary’s project names are both derived over ([names], REMOTE §8). Ridden out on the snapshot for the same reason the workspace set is: a name is a query over the live enumeration, and neither frontend may readdir to resolve one.

§trees: HashMap<PathBuf, GitTree>

Per-workspace derived trees; a workspace absent here failed to derive.

§bills: HashMap<PathBuf, Vec<StepBill>>

Per-workspace steps/ walk (§3.5, bl-9dd4): every step’s Usage fold and the model that billed it, folded once per pass on the worker. Every spend figure — a conversation’s, a ball’s, the V4 board’s column, an epic rollup across workspaces — is a filter over this, so a board of N balls costs one walk rather than N on the frame thread (§7.2). Derived, never stored: it is re-walked from disk like every other §5.1 fact.

§windows: BTreeMap<String, u64>

The context windows models.yaml declares, wire-model id → tokens (§5.1 #35): the denominator of every context-fullness figure, read by the worker on the same 15 s full sweep the balls fetch rides. World-wide rather than per-workspace because the file is — §9.2’s global litany config, one home for the declaration. Empty is the ordinary quiet case: nothing declared, so nothing is rendered.

§balls_by_project: HashMap<PathBuf, Vec<Ball>>

Cached live balls per visible project (§5.1 #2).

§closed_by_project: HashMap<PathBuf, Vec<Ball>>

Cached closed balls per project (§5.1 #4) — fetched on demand, never on the cadence, so this is sparse by design. Published beside the live map because the §3.5 Delivered rows and the §8.5 search corpus are the same fact asked twice: whatever closed set this world has fetched.

§join_rows: Vec<JoinRow>

The derived §3.5 join (roster badges + verb enablement).

§ops: Vec<OpRow>

The ops.jsonl tail (§4.2), the ops-pane render source.

§growth: Vec<Growth>

Conversations whose descent grew since the previous snapshot (§7.2).

§ui_bytes: Option<Vec<u8>>

Externally-changed ui.json bytes for the frame to adopt (§4.1).

§derived_at_unix: i64

When this derivation completed, in unix seconds off the injected clock — the staleness datum (§7.2), and the one the workspaces answer dates its stale line against.

§cadence: Cadence

The clock’s live periods (bl-3381): the worker’s read of cadence.yaml (or the defaults), ridden out so every frame-side derived period — the wound grace, the staleness bound, the I4 poll floor — follows the operator’s tuning without the frame reading disk (§7.2).

§fleet: BTreeMap<String, Policy>

The armed §4.3 fleet loops, keyed by workspace (bl-66fb): the worker’s read of the same cadence.yaml, ridden out for the same reason the periods above are — the V4 board renders the cap and the count, and a frame must not read disk to say them. Empty is the default and the ordinary world: no entry, no loop, no fact.

Implementations§

Source§

impl Snapshot

Source

pub fn ws_name(&self, path: &Path) -> String

The wire name of the workspace at path (§3.1: its leaf is its name). Total over any path — the enumeration is not consulted, because a workspace’s name is not derived from the set it sits in.

Source

pub fn ws_path(&self, name: &str) -> Result<PathBuf, String>

The workspace name addresses, or the refusal naming the token.

Source

pub fn project_name(&self, path: &Path) -> String

The wire name of the project at path (§5.1 #1) — the §11 roster label before its cosmetic elision.

Source

pub fn project_path(&self, name: &str) -> Result<PathBuf, String>

The project name addresses, or the refusal naming the token.

Source§

impl Snapshot

Source

pub fn scoped(&self, allowed: &BTreeSet<String>) -> Snapshot

This derivation as a client registered in allowed sees it: every workspace-keyed field filtered to those names, everything else untouched.

Total over any name set — an empty one yields a snapshot with no workspace at all, which is the honest view a certificate the operator has not seated gets, and which every read surface already answers without a bootstrap branch (Snapshot::empty is that same shape).

Trait Implementations§

Source§

impl Clone for Snapshot

Source§

fn clone(&self) -> Snapshot

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 Snapshot

Source§

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

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

impl Eq for Snapshot

Source§

impl PartialEq for Snapshot

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Snapshot

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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> Same for T

Source§

type Output = T

Should always be Self
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.