Skip to main content

Module session_engine

Module session_engine 

Source
Expand description

Session-engine traits and registry: retained document sessions producing paint frames (the genet HTML lanes, smolweb native). Session-engine traits and registry — the third engine kind (2026-07-10 session-engines plan).

Document engines (Engine) are request/response: bytes in, serializable EngineDocument blocks out — the stored/authored lane. Surface engines (SurfaceEngine) stream GPU textures from external producers. Session engines sit between: retained document sessions that lay content out once and then produce paint frames on demand, with scroll, activation, and (for scripted lanes) a tick + quiescence seam. The genet HTML lanes and the smolweb native lane are session engines.

The frame type is generic (F) so this crate keeps zero paint dependencies: a netrender host instantiates F = netrender::Scene; a different host picks its own frame type. Lane-specific construction seams (resource fetchers, cookie jars, themes) are injected into the concrete SessionEngine at registration time, not carried in the spawn request — the request stays plain data.

Structs§

ContentLineage
Host-neutral derivation evidence for an inspected document session.
ContentReport
A structural report of a session’s addressed content — title, an outline of role + name, outgoing links, headings. The introspection CONTRACT for DocumentSession::inspect: pure data, so it lives here rather than in a render crate (genet-render’s content_report builds one from a LayoutDom and re-exports these types). Hosts that cannot downcast a session to its concrete type (the type may be private to its engine crate) read this instead — turnstone’s Inspector pane is the first such consumer.
DocumentClip
A host-neutral semantic fragment offered by a retained document session.
DocumentClipArtifact
Exact source material offered with a semantic clip. The receiving domain decides whether and where to retain it.
DocumentFindMatch
One retained match, in document order.
DocumentFindQuery
A host-neutral document find query.
DocumentFindState
The retained result model shared by retained documents and hosted engines.
DocumentZoomState
The retained page-zoom model shared by retained documents and hosted engines.
EngineKindIndex
Non-generic id-to-kind resolution: which registries hold each id is just a map, so hosts resolve kinds without threading the frame type through code that never touches frames. Built after registration from the registries’ id sets; host-handled ids (internal pages, ingest markers) are the host’s own vocabulary and deliberately absent.
EngineKinds
Which registries hold an engine id. An id may be held by more than one kind (a smolweb format can have both a block engine for cards and a session engine for tiles); the HOST picks by surface context, so this is reported as flags, not a single kind.
HostMutation
One host-driven DOM change, named in engine-neutral terms.
HostMutationReport
What one DocumentSession::apply_host_mutations batch actually did.
OutlineEntry
One element in the structural outline.
SessionDocumentRequest
Spawns retained document sessions for the engine id it claims. Registered once per host; holds its lane’s construction seams (fetcher, cookie jar, theme) so the spawn request stays plain data. Exact document request intent, independent of any transport crate.
SessionEncodedFormSubmission
SessionExternalTextureDraw
A same-device producer texture placed within the latest session frame. Keys identify host-registered textures, never arbitrary document resources.
SessionFormSubmission
A form submission assembled by the engine from its retained form state. The host still owns URL resolution, transport, policy, and navigation.
SessionInputResult
Complete result of one input dispatch, including presentation requests that belong to the host adapter rather than the document engine.
SessionLink
A link the session exposes for the host’s hit table: url + viewport-space rect ([x, y, w, h], the shape the lanes already emit).
SessionModifiers
Modifier state carried with host-neutral session input.
SessionPendingWork
Work a hosted document still owns after the current turn.
SessionRegistry
Session engines keyed by engine id, one registry per host frame type.
SessionRequestSpawnResult
SessionSpawnRequest
Plain-data request to open a document session. The body is already fetched when the host has it (mirroring EngineInput); a session engine whose lane fetches for itself (subresources, redirects) uses the seams it was constructed with.
SessionTextTarget
A semantic text occurrence resolved to lane-local pointer coordinates.

Enums§

DocumentClipArtifactRole
The relationship between retained bytes and the representation observed by a document engine.
DocumentFindDirection
Direction for stepping a retained document find model.
DocumentFindReveal
How selecting a match is revealed by its owning engine.
HostMutationOp
What a HostMutation does to its target. The four shapes the T3 instrument needs: replace an attribute (style, class), drop one, grow the subtree, shrink it.
SessionButtonState
Press/release state shared by pointer and keyboard events.
SessionClick
What a click did, unifying the lanes’ divergent returns (ClickOutcome / bool / Option<String>).
SessionCursor
Cursor requested by the retained content under the pointer.
SessionEffect
Semantic effect of one session input. Navigation remains a host action; sessions name the target or submission and never fetch a replacement page.
SessionError
SessionFocusDirection
Direction requested by focus traversal.
SessionFormMethod
The transport method requested by a form submission.
SessionIme
Platform composition lifecycle translated without exposing a windowing crate to document engines.
SessionInput
Input delivered by a host to one retained session. For a printable key, send Key first and then its produced KeyboardText. Key owns keyboard events and non-text defaults; KeyboardText owns that key’s character edit and can be suppressed by a canceled keydown. Text is independent input, including paste and accessibility, and is never canceled by an earlier key. An IME commit uses Ime::Commit. Send control keys such as Enter only as Key; independent Text may contain newlines.
SessionKey
Keyboard keys with document-level meaning. Text-bearing keys retain the produced character string so this vocabulary does not assume ASCII.
SessionNavigationCommand
Navigation commands owned by the host around a retained session.
SessionPointerButton
Pointer buttons understood by a retained document session.
SessionScrollKey
Keyboard scroll intents, host-neutral. Adapters map these onto their document lane’s own scroll vocabulary; this contract does not drag a layout dependency into Inker.

Traits§

DocumentSession
A live document: a retained layout session producing paint frames.
SessionEngine

Functions§

dispatch_session_input
The compatibility input dispatcher, shared by lanes which clear pending request state before delegating to these actual interaction hooks.