pub struct SessionState {Show 13 fields
pub id: String,
pub version: u32,
pub started_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub project_root: Option<String>,
pub task: Option<TaskInfo>,
pub findings: Vec<Finding>,
pub decisions: Vec<Decision>,
pub files_touched: Vec<FileTouched>,
pub test_results: Option<TestSnapshot>,
pub progress: Vec<ProgressEntry>,
pub next_steps: Vec<String>,
pub stats: SessionStats,
}Fields§
§id: String§version: u32§started_at: DateTime<Utc>§updated_at: DateTime<Utc>§project_root: Option<String>§task: Option<TaskInfo>§findings: Vec<Finding>§decisions: Vec<Decision>§files_touched: Vec<FileTouched>§test_results: Option<TestSnapshot>§progress: Vec<ProgressEntry>§next_steps: Vec<String>§stats: SessionStatsImplementations§
Source§impl SessionState
impl SessionState
pub fn new() -> Self
pub fn increment(&mut self)
pub fn should_save(&self) -> bool
pub fn set_task(&mut self, description: &str, intent: Option<&str>)
pub fn add_finding( &mut self, file: Option<&str>, line: Option<u32>, summary: &str, )
pub fn add_decision(&mut self, summary: &str, rationale: Option<&str>)
pub fn touch_file( &mut self, path: &str, file_ref: Option<&str>, mode: &str, tokens: usize, )
pub fn mark_modified(&mut self, path: &str)
pub fn set_test_results( &mut self, command: &str, passed: u32, failed: u32, total: u32, )
pub fn add_progress(&mut self, action: &str, detail: Option<&str>)
pub fn record_tool_call(&mut self, tokens_saved: u64, tokens_input: u64)
pub fn record_cache_hit(&mut self)
pub fn record_command(&mut self)
pub fn format_compact(&self) -> String
pub fn save(&mut self) -> Result<(), String>
pub fn load_latest() -> Option<Self>
pub fn load_by_id(id: &str) -> Option<Self>
pub fn list_sessions() -> Vec<SessionSummary>
pub fn cleanup_old_sessions(max_age_days: i64) -> u32
Trait Implementations§
Source§impl Clone for SessionState
impl Clone for SessionState
Source§fn clone(&self) -> SessionState
fn clone(&self) -> SessionState
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 SessionState
impl Debug for SessionState
Source§impl Default for SessionState
impl Default for SessionState
Source§impl<'de> Deserialize<'de> for SessionState
impl<'de> Deserialize<'de> for SessionState
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 SessionState
impl RefUnwindSafe for SessionState
impl Send for SessionState
impl Sync for SessionState
impl Unpin for SessionState
impl UnsafeUnpin for SessionState
impl UnwindSafe for SessionState
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