pub struct SessionDeferredTurnState {
pub first_turn_phase: DeferredFirstTurnPhase,
pub pending_initial_prompt: Option<PendingDeferredPrompt>,
pub pending_tool_results: Vec<PendingToolResultsMessage>,
}Expand description
Durable control state for deferred first-turn prompt and staged callback tool results.
Fields§
§first_turn_phase: DeferredFirstTurnPhase§pending_initial_prompt: Option<PendingDeferredPrompt>§pending_tool_results: Vec<PendingToolResultsMessage>Implementations§
Source§impl SessionDeferredTurnState
impl SessionDeferredTurnState
Sourcepub fn mark_initial_turn_pending(&mut self)
pub fn mark_initial_turn_pending(&mut self)
Mark that this session has a deferred first turn waiting to start.
Sourcepub fn mark_initial_turn_started(&mut self) -> bool
pub fn mark_initial_turn_started(&mut self) -> bool
Mark the deferred first turn as started.
Returns true when the phase transitioned from Pending.
Sourcepub fn restore_initial_turn_pending(&mut self)
pub fn restore_initial_turn_pending(&mut self)
Restore the deferred first-turn pending phase after a failed pre-run setup.
Sourcepub fn allows_initial_turn_overrides(&self) -> bool
pub fn allows_initial_turn_overrides(&self) -> bool
Whether build-only first-turn overrides are still legal for this session.
Sourcepub fn stage_initial_prompt(
&mut self,
prompt: ContentInput,
accepted_at: SystemTime,
)
pub fn stage_initial_prompt( &mut self, prompt: ContentInput, accepted_at: SystemTime, )
Stage the create-time prompt for a later first turn.
Sourcepub fn stage_tool_results(
&mut self,
results: Vec<ToolResult>,
accepted_at: SystemTime,
) -> usize
pub fn stage_tool_results( &mut self, results: Vec<ToolResult>, accepted_at: SystemTime, ) -> usize
Stage one callback tool-results message for the next turn.
Sourcepub fn take_initial_prompt(&mut self) -> Option<ContentInput>
pub fn take_initial_prompt(&mut self) -> Option<ContentInput>
Consume the staged initial prompt, if any.
Sourcepub fn take_tool_results(&mut self) -> Vec<PendingToolResultsMessage>
pub fn take_tool_results(&mut self) -> Vec<PendingToolResultsMessage>
Consume all staged callback tool-results messages.
Sourcepub fn has_pending_tool_results(&self) -> bool
pub fn has_pending_tool_results(&self) -> bool
Whether any callback tool results are currently staged.
Trait Implementations§
Source§impl Clone for SessionDeferredTurnState
impl Clone for SessionDeferredTurnState
Source§fn clone(&self) -> SessionDeferredTurnState
fn clone(&self) -> SessionDeferredTurnState
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 SessionDeferredTurnState
impl Debug for SessionDeferredTurnState
Source§impl Default for SessionDeferredTurnState
impl Default for SessionDeferredTurnState
Source§fn default() -> SessionDeferredTurnState
fn default() -> SessionDeferredTurnState
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SessionDeferredTurnState
impl<'de> Deserialize<'de> for SessionDeferredTurnState
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
Source§impl PartialEq for SessionDeferredTurnState
impl PartialEq for SessionDeferredTurnState
Source§impl Serialize for SessionDeferredTurnState
impl Serialize for SessionDeferredTurnState
impl StructuralPartialEq for SessionDeferredTurnState
Auto Trait Implementations§
impl Freeze for SessionDeferredTurnState
impl RefUnwindSafe for SessionDeferredTurnState
impl Send for SessionDeferredTurnState
impl Sync for SessionDeferredTurnState
impl Unpin for SessionDeferredTurnState
impl UnsafeUnpin for SessionDeferredTurnState
impl UnwindSafe for SessionDeferredTurnState
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