Expand description
The Mode trait, plus ModeId, ModeKind, and the
LifecycleFuture type alias.
Structs§
- Editable
Tail - An editable region at the tail of an otherwise read-only,
owner-written buffer — the comint pattern (AU‑3) (the agent-conversation prompt,
future
*scratch*/ REPL input lines). A mode declares it viaMode::editable_tail; the host’s read-only edit gate consults it so user keystrokes may edit only the tail while the owner’s projection writes (which bypass the gate by going through the runtime document handle directly) keep the rest owner-controlled. - ModeId
- Canonical identity of a mode. Interned-string for
Copy + Eq + Hashat zero allocation cost on the hot path.
Enums§
- Activation
Policy - A minor mode’s default auto-activation policy — the allowlist of
major modes it activates inside, as the mode itself ships it
(mode-architecture.md §7.4). The host’s minor-activation resolver
subscribes once to [
lattice_protocol::Event::MajorEntered] and, for each registered minor whose policyadmitsthe entered major, activates it. - Mode
Kind - Major / minor distinction. A buffer has exactly one major and any number of minors active simultaneously (mode-architecture.md §3).
Traits§
- DynMode
- Object-safe adapter for
Mode. The registry stores modes asArc<dyn DynMode>; the blanket impl below box-erases eachMode’s typedGuardintoBox<dyn Any + Send>so the dispatcher can stash heterogeneous Guards in a singleGuardStoreand drop them on deactivation. - Mode
- Declarative mode contract.
Type Aliases§
- Lifecycle
Future - Pinned, boxed, send-able future for
Mode::on_activate.