pub struct SerdeCheckpointCodec<S: WorkflowState = State> { /* private fields */ }Expand description
基于 Serde + JSON 的默认 Codec 实现。
使用 serde_json 进行序列化,适用于大多数场景。
对于性能敏感场景,可替换为 Bincode 或 MessagePack。
Implementations§
Source§impl<S: WorkflowState> SerdeCheckpointCodec<S>
impl<S: WorkflowState> SerdeCheckpointCodec<S>
Trait Implementations§
Source§impl<S> CheckpointCodec<S> for SerdeCheckpointCodec<S>
impl<S> CheckpointCodec<S> for SerdeCheckpointCodec<S>
Source§fn serialize(
&self,
cp: &Checkpoint<S>,
graph_hash: u64,
) -> Result<CheckpointBlob, CheckpointStoreError>
fn serialize( &self, cp: &Checkpoint<S>, graph_hash: u64, ) -> Result<CheckpointBlob, CheckpointStoreError>
将 Checkpoint 序列化为二进制 Blob。 Read more
Source§fn deserialize(
&self,
blob: &CheckpointBlob,
expected_hash: u64,
) -> Result<Checkpoint<S>, CheckpointStoreError>
fn deserialize( &self, blob: &CheckpointBlob, expected_hash: u64, ) -> Result<Checkpoint<S>, CheckpointStoreError>
从二进制 Blob 反序列化为 Checkpoint。 Read more
Source§impl<S: Debug + WorkflowState> Debug for SerdeCheckpointCodec<S>
impl<S: Debug + WorkflowState> Debug for SerdeCheckpointCodec<S>
Source§impl<S: Default + WorkflowState> Default for SerdeCheckpointCodec<S>
impl<S: Default + WorkflowState> Default for SerdeCheckpointCodec<S>
Source§fn default() -> SerdeCheckpointCodec<S>
fn default() -> SerdeCheckpointCodec<S>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<S> Freeze for SerdeCheckpointCodec<S>
impl<S> RefUnwindSafe for SerdeCheckpointCodec<S>where
S: RefUnwindSafe,
impl<S> Send for SerdeCheckpointCodec<S>
impl<S> Sync for SerdeCheckpointCodec<S>
impl<S> Unpin for SerdeCheckpointCodec<S>where
S: Unpin,
impl<S> UnsafeUnpin for SerdeCheckpointCodec<S>
impl<S> UnwindSafe for SerdeCheckpointCodec<S>where
S: UnwindSafe,
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