pub enum Event {
Create(Arc<State>),
TrApply {
old_state: Arc<State>,
new_state: Arc<State>,
transactions: Vec<Arc<Transaction>>,
},
Undo {
old_state: Arc<State>,
new_state: Arc<State>,
transactions: Vec<Arc<Transaction>>,
},
Redo {
old_state: Arc<State>,
new_state: Arc<State>,
transactions: Vec<Arc<Transaction>>,
},
Jump {
old_state: Arc<State>,
new_state: Arc<State>,
transactions: Vec<Arc<Transaction>>,
steps: isize,
},
TrFailed {
state: Arc<State>,
transaction: Transaction,
error: String,
},
HistoryCleared,
Destroy,
Stop,
}Variants§
Create(Arc<State>)
状态创建事件
TrApply
事务应用事件 (old_state, new_state, transactions) 统一使用新旧状态模式,与 Undo/Redo 保持一致
Undo
撤销事件 (old_state, new_state, undone_transactions) 包含被撤销的事务列表,供其他组件(如搜索索引)使用
Redo
重做事件 (old_state, new_state, redone_transactions) 包含重做的事务列表,供其他组件(如搜索索引)使用
Jump
历史跳转事件 (old_state, new_state, transactions, steps) 当用户跳转到历史中的特定位置时触发 transactions 包含跳转过程中所有被影响的事务
TrFailed
事务失败事件 当事务应用失败时触发,供错误处理和日志记录使用
HistoryCleared
历史清空事件 当历史记录被清空时触发
Destroy
销毁事件
Stop
停止事件(需要重启)
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Event
impl !RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl !UnwindSafe for Event
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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>
Converts
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>
Converts
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 moreSource§impl<T> Message for T
impl<T> Message for T
Source§fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
Convert a BoxedMessage to this concrete type
Source§fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
Convert this message to a BoxedMessage