pub struct SessionCheckpointSink<'a, S: WorkflowState = State>where
S::Checkpoint: Debug,{ /* private fields */ }Expand description
Session 的 Checkpoint Sink — 将 checkpoint 事件写入 FrameStack。
这是 CheckpointSink SPI 的实现之一。Engine 通过借用 &dyn CheckpointSink<S>
通知到达恢复边界,SessionCheckpointSink 负责将 Frame 推入 FrameStack。
§设计原则
Engine 不知道 FrameStack 的存在,只调用 sink.on_checkpoint(&state, &frame_info)。
SessionCheckpointSink 是适配器,将通用的 checkpoint 事件转换为 FrameStack 操作。
Implementations§
Source§impl<'a, S: WorkflowState> SessionCheckpointSink<'a, S>where
S::Checkpoint: Debug,
impl<'a, S: WorkflowState> SessionCheckpointSink<'a, S>where
S::Checkpoint: Debug,
Sourcepub fn new(
frame_stack: &'a mut FrameStack<S>,
graph_name: impl Into<String>,
) -> Self
pub fn new( frame_stack: &'a mut FrameStack<S>, graph_name: impl Into<String>, ) -> Self
创建 SessionCheckpointSink,绑定到 FrameStack。
Trait Implementations§
Source§impl<S: WorkflowState> CheckpointSink<S> for SessionCheckpointSink<'_, S>
impl<S: WorkflowState> CheckpointSink<S> for SessionCheckpointSink<'_, S>
Auto Trait Implementations§
impl<'a, S = State> !UnwindSafe for SessionCheckpointSink<'a, S>
impl<'a, S> Freeze for SessionCheckpointSink<'a, S>
impl<'a, S> RefUnwindSafe for SessionCheckpointSink<'a, S>
impl<'a, S> Send for SessionCheckpointSink<'a, S>
impl<'a, S> Sync for SessionCheckpointSink<'a, S>
impl<'a, S> Unpin for SessionCheckpointSink<'a, S>
impl<'a, S> UnsafeUnpin for SessionCheckpointSink<'a, S>
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