pub struct SessionData {Show 17 fields
pub id: String,
pub config: SessionConfig,
pub state: SessionState,
pub messages: Vec<Message>,
pub context_usage: ContextUsage,
pub total_usage: TokenUsage,
pub total_cost: f64,
pub model_name: Option<String>,
pub cost_records: Vec<LlmCostRecord>,
pub tool_names: Vec<String>,
pub thinking_enabled: bool,
pub thinking_budget: Option<usize>,
pub created_at: i64,
pub updated_at: i64,
pub llm_config: Option<LlmConfigData>,
pub tasks: Vec<Task>,
pub parent_id: Option<String>,
}Expand description
Serializable session data for persistence
Contains only the fields that can be serialized. Non-serializable fields (event_tx, command_queue, etc.) are rebuilt on load.
Fields§
§id: StringSession ID
config: SessionConfigSession configuration
state: SessionStateCurrent state
messages: Vec<Message>Conversation history
context_usage: ContextUsageContext usage statistics
total_usage: TokenUsageTotal token usage
total_cost: f64Cumulative dollar cost for this session
model_name: Option<String>Model name for cost calculation
cost_records: Vec<LlmCostRecord>LLM cost records for this session
tool_names: Vec<String>Tool definitions (names only, rebuilt from executor on load)
thinking_enabled: boolWhether thinking mode is enabled
thinking_budget: Option<usize>Thinking budget if set
created_at: i64Creation timestamp (Unix epoch seconds)
updated_at: i64Last update timestamp (Unix epoch seconds)
llm_config: Option<LlmConfigData>LLM configuration for per-session client (if set)
tasks: Vec<Task>Task list for tracking
parent_id: Option<String>Parent session ID (for subagent sessions)
Implementations§
Source§impl SessionData
impl SessionData
Sourcepub fn tool_names_from_definitions(tools: &[ToolDefinition]) -> Vec<String>
pub fn tool_names_from_definitions(tools: &[ToolDefinition]) -> Vec<String>
Extract tool names from definitions
Trait Implementations§
Source§impl Clone for SessionData
impl Clone for SessionData
Source§fn clone(&self) -> SessionData
fn clone(&self) -> SessionData
Returns a duplicate of the value. Read more
1.0.0 · 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 SessionData
impl Debug for SessionData
Source§impl<'de> Deserialize<'de> for SessionData
impl<'de> Deserialize<'de> for SessionData
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 SessionData
impl !RefUnwindSafe for SessionData
impl Send for SessionData
impl Sync for SessionData
impl Unpin for SessionData
impl UnsafeUnpin for SessionData
impl !UnwindSafe for SessionData
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