pub struct LashSession { /* private fields */ }Implementations§
Source§impl LashSession
impl LashSession
pub async fn close(self) -> Result<()>
pub fn session_id(&self) -> String
pub fn policy_snapshot(&self) -> SessionPolicy
pub fn observe(&self) -> ObservableSession
pub fn parent_session_id(&self) -> Option<&str>
pub fn effect_host(&self) -> Arc<dyn EffectHost> ⓘ
pub fn turn(&self, input: TurnInput) -> TurnBuilder
pub fn queued_turn(&self) -> QueuedTurnBuilder
Sourcepub fn cancel_running_turns(&self) -> usize
pub fn cancel_running_turns(&self) -> usize
Cancel every turn currently executing through this opened session (including its clones) and report how many were signalled.
This is the affordance behind a UI “stop” control: hold a clone of the
session wherever the stop arrives and call this, instead of threading a
CancellationToken into every turn call
(TurnBuilder::cancel remains the
per-turn hook when you need one). A cancelled turn finishes with
TurnOutcome::Stopped(TurnStop::Cancelled) and commits like any other
turn; the session stays usable.
Scope: turns started from this LashSession instance and its clones.
A handle opened separately for the same session id has its own
registry and is not reached.
pub fn admin(&self) -> SessionAdmin
pub async fn configure(&self, patch: SessionConfigPatch) -> Result<()>
pub fn tools(&self) -> ToolAdmin
pub fn commands(&self) -> SessionCommandAdmin
pub fn triggers(&self) -> SessionTriggerAdmin
pub fn processes(&self) -> SessionProcessAdmin
pub fn plugin_operations(&self) -> PluginOperations
pub fn enqueue(&self, input: TurnInput) -> EnqueueTurnBuilder<'_>
Sourcepub async fn queued_work(&self) -> Result<Vec<QueuedWorkBatch>>
pub async fn queued_work(&self) -> Result<Vec<QueuedWorkBatch>>
Return all pending durable queued-work batches for this session.
This is an admin/introspection view for non-user queued work such as
process wakes and session commands. User-visible model input is stored
separately as pending turn input and is exposed by
pending_turn_inputs.
pub async fn pending_turn_inputs(&self) -> Result<Vec<PendingTurnInput>>
pub async fn cancel_pending_turn_input( &self, input_id: &str, ) -> Result<PendingTurnInputCancelOutcome>
Sourcepub async fn cancel_pending_turn_inputs(
&self,
targets: impl IntoIterator<Item = PendingTurnInputCancelTarget>,
) -> Result<Vec<PendingTurnInputCancelResult>>
pub async fn cancel_pending_turn_inputs( &self, targets: impl IntoIterator<Item = PendingTurnInputCancelTarget>, ) -> Result<Vec<PendingTurnInputCancelResult>>
Atomically cancel a set of pending user inputs by runtime input id or app source key.
This is the app reconciliation path for explicit selections such as “remove these pending drafts”. Returned outcomes distinguish newly cancelled input from input that was already claimed, completed, cancelled, or missing.
Sourcepub async fn cancel_pending_turn_input_suffix(
&self,
anchor: PendingTurnInputCancelTarget,
) -> Result<PendingTurnInputSuffixCancelOutcome>
pub async fn cancel_pending_turn_input_suffix( &self, anchor: PendingTurnInputCancelTarget, ) -> Result<PendingTurnInputSuffixCancelOutcome>
Atomically cancel the same-session pending-input suffix from anchor.
Apps that let users edit previously submitted product messages should
map the edited message to the stored pending-input input_id or
source_key, call this method, and only restore/edit drafts that return
PendingTurnInputCancelOutcome::Cancelled. Claimed or completed
inputs have already crossed the runtime boundary and should be treated
as reconciliation state, not local editable drafts.
pub async fn cancel_queued_work_batch( &self, batch_id: &str, ) -> Result<Option<QueuedWorkBatch>>
Sourcepub async fn await_queued_work_batch(&self, batch_id: &str) -> Result<()>
pub async fn await_queued_work_batch(&self, batch_id: &str) -> Result<()>
Resolve once batch_id is no longer pending in the queue store —
drained by whoever runs queued work (a queued-work runner, a durable
worker, or another handle’s queued_turn) or
cancelled. This is the enqueue-and-observe side of the queue: the
caller never claims the work itself.
Completion is read from the persistent queue store, so it observes
drains performed by other session handles and other processes alike.
There is no built-in deadline — nothing resolves if nothing drains the
queue, so bound it with tokio::time::timeout when the worker may be
unavailable. A batch id the store has never seen resolves immediately.
pub fn read_view(&self) -> SessionReadView
pub fn usage_report(&self) -> SessionUsageReport
pub async fn set_turn_phase_probe(&self, probe: Arc<dyn RuntimeTurnPhaseProbe>)
Trait Implementations§
Source§impl Clone for LashSession
impl Clone for LashSession
Source§fn clone(&self) -> LashSession
fn clone(&self) -> LashSession
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more