Struct SubtreeSpend
pub struct SubtreeSpend { /* private fields */ }Expand description
Process-local subtree accounting for one hop of a delegation chain.
Single source of truth: the durable ledger remains the source of truth for every alias’s own daily spend, which budget checks read per alias; the descendant accumulator holds only what THIS delegation chain’s descendants recorded during this process lifetime. It exists because descendants attribute their ledger records to their own alias, not the ancestor’s, so an ancestor’s per-alias daily total alone cannot see them. Descendant accounting is per process lifetime and per UTC day: each record lands in the accumulator under the UTC day of its own timestamp, the same day the ledger’s daily aggregates fold that row into, so the accumulator rolls over with the ledger’s daily totals at UTC midnight instead of carrying one day’s descendant spend into the next day’s ceiling check. A daemon restart therefore forgets descendant spend while every alias’s own ledger total persists.
Shared by Arc into the budget scopes of the whole chain: the entry’s
owning scope checks it in check_budget, and every descendant tracker
recording under an inherited chain adds its recorded cost to the
accumulator. A descendant recording under an alias that also appears
as an ancestor entry (a chain that revisits an agent) does not add to
that entry: the ancestor’s check already reads the row through its
alias’s ledger total.
Auto Trait Implementations§
impl !Freeze for SubtreeSpend
impl !RefUnwindSafe for SubtreeSpend
impl Send for SubtreeSpend
impl Sync for SubtreeSpend
impl Unpin for SubtreeSpend
impl UnsafeUnpin for SubtreeSpend
impl UnwindSafe for SubtreeSpend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more