Skip to main content

EventStore

Struct EventStore 

Source
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>

Source

pub fn new() -> Self

Source

pub fn resize(&mut self, count: usize)

槽位扩到 count(不缩;新槽为空 = 未索引)。

Source

pub fn slot(&self, idx: usize) -> Option<&[RegionEvent<Id, NameKey>]>

None = 未索引(调用方回落引擎递归路径);Some([]) = 已索引 且零事件(调用方直接返回,不再递归)。

Source

pub fn put(&mut self, idx: usize, events: Vec<RegionEvent<Id, NameKey>>)

Source

pub fn is_clean(&self) -> bool

Source

pub fn mark_clean(&mut self)

Source

pub fn invalidate(&mut self, idx: usize)

失效一个语句条目(编辑沿祖先链调用):清空该槽 + 整表脏标记 (B3:下次 prepare 只重建空条目——未失效条目的事件是子树 局部的,与位置无关)。

Trait Implementations§

Source§

impl<Id: Debug, NameKey: Debug> Debug for EventStore<Id, NameKey>

Source§

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

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

impl<Id, NameKey> Default for EventStore<Id, NameKey>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<Id, NameKey> Freeze for EventStore<Id, NameKey>
where Vec<Option<Vec<RegionEvent<Id, NameKey>>>>: Freeze,

§

impl<Id, NameKey> RefUnwindSafe for EventStore<Id, NameKey>
where Vec<Option<Vec<RegionEvent<Id, NameKey>>>>: RefUnwindSafe,

§

impl<Id, NameKey> Send for EventStore<Id, NameKey>
where Vec<Option<Vec<RegionEvent<Id, NameKey>>>>: Send,

§

impl<Id, NameKey> Sync for EventStore<Id, NameKey>
where Vec<Option<Vec<RegionEvent<Id, NameKey>>>>: Sync,

§

impl<Id, NameKey> Unpin for EventStore<Id, NameKey>
where Vec<Option<Vec<RegionEvent<Id, NameKey>>>>: Unpin,

§

impl<Id, NameKey> UnsafeUnpin for EventStore<Id, NameKey>
where Vec<Option<Vec<RegionEvent<Id, NameKey>>>>: UnsafeUnpin,

§

impl<Id, NameKey> UnwindSafe for EventStore<Id, NameKey>
where Vec<Option<Vec<RegionEvent<Id, NameKey>>>>: UnwindSafe,

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