pub struct SessionState {
pub session_id: String,
pub project_root: Option<PathBuf>,
pub log_path: Option<PathBuf>,
pub start_time: DateTime<Utc>,
pub last_activity: DateTime<Utc>,
pub model: Option<String>,
pub context_window_limit: Option<u64>,
pub current_usage: ContextWindowUsage,
pub current_reasoning_tokens: i32,
pub error_count: u32,
pub event_count: usize,
pub turn_count: usize,
}Fields§
§session_id: String§project_root: Option<PathBuf>§log_path: Option<PathBuf>§start_time: DateTime<Utc>§last_activity: DateTime<Utc>§model: Option<String>§context_window_limit: Option<u64>§current_usage: ContextWindowUsage§current_reasoning_tokens: i32§error_count: u32§event_count: usize§turn_count: usizeImplementations§
Source§impl SessionState
impl SessionState
pub fn new( session_id: String, project_root: Option<PathBuf>, log_path: Option<PathBuf>, start_time: DateTime<Utc>, ) -> Self
pub fn total_input_side_tokens(&self) -> i32
pub fn total_output_side_tokens(&self) -> i32
pub fn total_context_window_tokens(&self) -> i32
Sourcepub fn total_tokens(&self) -> TokenCount
pub fn total_tokens(&self) -> TokenCount
Get total tokens as type-safe TokenCount
Sourcepub fn context_limit(&self) -> Option<ContextLimit>
pub fn context_limit(&self) -> Option<ContextLimit>
Get context limit as type-safe ContextLimit
pub fn validate_tokens(&self, model_limit: Option<u64>) -> Result<(), String>
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 moreAuto Trait Implementations§
impl Freeze for SessionState
impl RefUnwindSafe for SessionState
impl Send for SessionState
impl Sync for SessionState
impl Unpin 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