pub struct TemporalIndex { /* private fields */ }Implementations§
Source§impl TemporalIndex
impl TemporalIndex
pub fn new() -> Self
Sourcepub fn load(&mut self, record: TemporalRecord)
pub fn load(&mut self, record: TemporalRecord)
Seeds one persisted row (temporalIndex()’s KV load loop in src/core/compositor.ts calls this once per
row, in KV scan order — ascending id).
Sourcepub fn decide(
&mut self,
comp_bounds: Rect,
comp_blocks: &[(i32, i32)],
frame: u32,
time: f64,
visible: Rect,
latest_policy: bool,
next_seq: u64,
) -> (usize, u64)
pub fn decide( &mut self, comp_bounds: Rect, comp_blocks: &[(i32, i32)], frame: u32, time: f64, visible: Rect, latest_policy: bool, next_seq: u64, ) -> (usize, u64)
The decision half of resolveTemporal up to (not including) the maskComplete walk — everything that
does not need atlas/occlusion/consistency pixels. Stashes the candidate record and returns how many
blocks mask_complete + the second call will need a buffer for (0 means this component’s record cannot
be chosen this frame, regardless of what the mask check would say), plus the (possibly incremented)
fresh-id sequence counter.
next_seq is NOT this index’s own state: Compositor.temporalSequence in src/core/compositor.ts is a
single counter shared across every canvas the Compositor ever touches (not reset per canvas), so the
caller threads it through every decide() call on every canvas’s handle and keeps the returned value —
never derived from loaded ids, which is why a fresh id can collide with a still-loaded row (see the
id-collision tripwire tests in tests/unit/compositor.test.ts).
Sourcepub fn pending_write_blocks(&self) -> &[(i32, i32)]
pub fn pending_write_blocks(&self) -> &[(i32, i32)]
The write-block set decide computed for the currently pending component (empty if none is pending, or
if it decided not to choose this component this frame) — read by the caller to run mask_complete
before calling commit.
Sourcepub fn commit(&mut self, mask_complete_ok: bool) -> Option<CommitOut>
pub fn commit(&mut self, mask_complete_ok: bool) -> Option<CommitOut>
Finalises the component decide staged: mirrors resolveTemporal’s tail (record commit into
records/dirty/deleted, and the INCOMPLETE_TEMPORAL_PATCH condition). mask_complete_ok is the
result of running mask_complete over pending_write_blocks() — irrelevant when decide already chose
not to attempt this component (chosen is then false regardless of this argument).
Sourcepub fn flush_sizes(&self) -> (usize, usize, usize)
pub fn flush_sizes(&self) -> (usize, usize, usize)
Sizes for the buffers flush_take will need: how many ids deleted (persisted rows to delete) and
dirty (persisted rows to (re)write) hold, and the total block count across every dirty record’s
current key set (persistedBlocks output length, summed) — flush() writes exactly these rows, deletions
first, in this order, mirrors Compositor.flush().
Sourcepub fn flush_take(&mut self) -> (Vec<String>, Vec<DirtyRow>)
pub fn flush_take(&mut self) -> (Vec<String>, Vec<DirtyRow>)
Drains deleted (in order) and dirty (in order, with each record’s current content and
persisted-order block list), clearing both. The counts must match a flush_sizes() call made with no
decide/commit/load in between (the caller sizes its output buffers from that call).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TemporalIndex
impl RefUnwindSafe for TemporalIndex
impl Send for TemporalIndex
impl Sync for TemporalIndex
impl Unpin for TemporalIndex
impl UnsafeUnpin for TemporalIndex
impl UnwindSafe for TemporalIndex
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
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