Skip to main content

Module session

Module session 

Source
Expand description

会话状态的契约:引擎从设置推出来的 SessionEnv、写进会话日志的 DurableState、 工具与策略经 Arc<dyn Session> 看到的 Session trait,以及绑定任务生命周期的 TaskScope / TaskLease。实现在 session-state crate,是这个 trait 唯一的实现。

Structs§

DurableState
The part of a session’s state that outlives its engine: what the model set up for itself, which an engine brought back from the log must still hold. The rest is derived from settings again or ends with the engine.
LiveDirs
A list of directories shared by everything handed a clone and replaced in place, so a session’s tools see a change without the session being rebuilt.
PlanState
In plan mode, and where ExitPlanMode returns to: None is Default, for a session that started out in plan mode.
ReadRecord
One Read whose result went to the model.
SessionEnv
What the engine running a session derives from its settings and scene. Each engine brings its own, and attaching an engine replaces the session’s whole.
TaskLease
A task whose holder says how it ended: registered on creation, ended by conclude. One dropped without concluding — its work panicked, was dropped from a queue, or its holder simply went away — ends as stopped, and the parent hears so when the lease was taken notifying it. No task held by a lease is left running.
TaskScope
A task that lasts as long as this value: registered on creation, ended on drop — stopped if its token was cancelled, done otherwise. For work bounded by one call, like a shell command.

Enums§

HeldRead
What the model holds of a file it read before.

Constants§

SESSION_STATE_EVENT
SESSION_STATE_NS
Log namespace and event under which DurableState is recorded.

Traits§

Session
What tools and permission policies see of the session they run in. The layering needs the trait, not an extension point: session-state holds the one implementation.

Functions§

stop_with_notice
Stop task from outside its lease, posting notice as its end’s notice before it ends. Of this and the lease, whichever comes first ends the task and notifies; the other leaves both to it.