pub struct SessionState {Show 13 fields
pub messages: Vec<Message>,
pub compacted_prefix: Vec<Value>,
pub file_view_cache: FileViewCache,
pub appended_prompt_segments: Vec<PromptSegment>,
pub pending_tool_calls: IndexMap<ToolCallId, PendingToolCall>,
pub usage_so_far: Usage,
pub summaries: Vec<SummarySlice>,
pub lineage: Vec<SubagentRef>,
pub fired_hook_ids: Vec<String>,
pub pending_session_start_source: Option<HookSessionStartSource>,
pub pending_warning_messages: Vec<HookWarning>,
pub last_response_id: Option<String>,
pub messages_seen_by_provider: usize,
}Expand description
Mutable state persisted for a session.
Fields§
§messages: Vec<Message>§compacted_prefix: Vec<Value>§file_view_cache: FileViewCache§appended_prompt_segments: Vec<PromptSegment>§pending_tool_calls: IndexMap<ToolCallId, PendingToolCall>§usage_so_far: Usage§summaries: Vec<SummarySlice>§lineage: Vec<SubagentRef>§fired_hook_ids: Vec<String>§pending_session_start_source: Option<HookSessionStartSource>§pending_warning_messages: Vec<HookWarning>§last_response_id: Option<String>The OpenAI Responses API response ID from the last successful turn.
Used for previous_response_id chaining to avoid re-sending full history.
messages_seen_by_provider: usizeNumber of messages the model has already seen via previous_response_id.
Messages at indices [0..messages_seen_by_provider) don’t need re-sending.
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 (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 SessionState
impl Debug for SessionState
Source§impl Default for SessionState
impl Default for SessionState
Source§fn default() -> SessionState
fn default() -> SessionState
Returns the “default value” for a type. Read more
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
impl Eq for SessionState
Source§impl JsonSchema for SessionState
impl JsonSchema for SessionState
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for SessionState
impl PartialEq for SessionState
Source§fn eq(&self, other: &SessionState) -> bool
fn eq(&self, other: &SessionState) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for SessionState
impl Serialize for SessionState
impl StructuralPartialEq for SessionState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.