pub struct SessionData {
pub id: String,
pub created_at: String,
pub updated_at: String,
pub cwd: String,
pub model: String,
pub messages: Vec<Message>,
pub turn_count: usize,
pub total_cost_usd: f64,
pub total_input_tokens: u64,
pub total_output_tokens: u64,
pub plan_mode: bool,
}Expand description
Serializable session state persisted to disk.
Auto-saved on exit, restored via /resume <id>. Stored as JSON
in ~/.config/agent-code/sessions/.
Fields§
§id: StringUnique session identifier.
created_at: StringTimestamp when the session was created.
updated_at: StringTimestamp of the last update.
cwd: StringWorking directory at session start.
model: StringModel used in this session.
messages: Vec<Message>Conversation messages.
turn_count: usizeTotal turns completed.
total_cost_usd: f64Total cost in USD.
total_input_tokens: u64Total input tokens.
total_output_tokens: u64Total output tokens.
plan_mode: boolWhether plan mode was active.
Trait Implementations§
Source§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