pub struct AgentCheckpoint {
pub messages: Vec<Message>,
pub iterations: usize,
pub total_tool_calls: usize,
pub output_tokens: usize,
pub reasoning_tokens: usize,
pub compact_count: usize,
pub stop_reason: Option<StopReason>,
}Expand description
Agent Checkpoint 投影 — 可序列化的快照。
只包含需要持久化的字段,不包含运行时字段(如 last_response)。
这是 P0-1 Checkpoint Projection 的核心:Runtime State 可以包含
不可序列化字段,Checkpoint 只序列化必要字段。
Fields§
§messages: Vec<Message>消息历史
iterations: usize当前迭代轮次
total_tool_calls: usize累计工具调用总数
output_tokens: usize累计输出 Token 数
reasoning_tokens: usize累计推理 Token 数
compact_count: usize累计压缩次数
stop_reason: Option<StopReason>停止原因
Trait Implementations§
Source§impl Clone for AgentCheckpoint
impl Clone for AgentCheckpoint
Source§fn clone(&self) -> AgentCheckpoint
fn clone(&self) -> AgentCheckpoint
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AgentCheckpoint
impl Debug for AgentCheckpoint
Source§impl<'de> Deserialize<'de> for AgentCheckpoint
impl<'de> Deserialize<'de> for AgentCheckpoint
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AgentCheckpoint
impl RefUnwindSafe for AgentCheckpoint
impl Send for AgentCheckpoint
impl Sync for AgentCheckpoint
impl Unpin for AgentCheckpoint
impl UnsafeUnpin for AgentCheckpoint
impl UnwindSafe for AgentCheckpoint
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