pub struct EventStore<Id, NameKey> { /* private fields */ }Expand description
事件存储(稠密:槽位 = arena 下标)+ B3 惰性重建的清洁标记。
「空序列 = 未索引」是三重哨兵:未构建、被 invalidate 失效、或
子树含不透明节点(不建索引——键排序分区看不见 Opaque 键,查询侧
走引擎的 scan_region 递归路径,其 Opaque 分支保守拒绝)。
Implementations§
Source§impl<Id: Clone, NameKey: Clone> EventStore<Id, NameKey>
impl<Id: Clone, NameKey: Clone> EventStore<Id, NameKey>
pub fn new() -> Self
Sourcepub fn slot(&self, idx: usize) -> Option<&[RegionEvent<Id, NameKey>]>
pub fn slot(&self, idx: usize) -> Option<&[RegionEvent<Id, NameKey>]>
None = 未索引(调用方回落引擎递归路径);Some([]) = 已索引
且零事件(调用方直接返回,不再递归)。
pub fn put(&mut self, idx: usize, events: Vec<RegionEvent<Id, NameKey>>)
pub fn is_clean(&self) -> bool
pub fn mark_clean(&mut self)
Sourcepub fn invalidate(&mut self, idx: usize)
pub fn invalidate(&mut self, idx: usize)
失效一个语句条目(编辑沿祖先链调用):清空该槽 + 整表脏标记 (B3:下次 prepare 只重建空条目——未失效条目的事件是子树 局部的,与位置无关)。
Trait Implementations§
Auto Trait Implementations§
impl<Id, NameKey> Freeze for EventStore<Id, NameKey>
impl<Id, NameKey> RefUnwindSafe for EventStore<Id, NameKey>
impl<Id, NameKey> Send for EventStore<Id, NameKey>
impl<Id, NameKey> Sync for EventStore<Id, NameKey>
impl<Id, NameKey> Unpin for EventStore<Id, NameKey>
impl<Id, NameKey> UnsafeUnpin for EventStore<Id, NameKey>
impl<Id, NameKey> UnwindSafe for EventStore<Id, NameKey>
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
Mutably borrows from an owned value. Read more