Skip to main content

Module mode

Module mode 

Source
Expand description

The Mode trait, plus ModeId, ModeKind, and the LifecycleFuture type alias.

Structs§

EditableTail
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 via Mode::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 + Hash at zero allocation cost on the hot path.

Enums§

ActivationPolicy
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 policy admits the entered major, activates it.
ModeKind
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 as Arc<dyn DynMode>; the blanket impl below box-erases each Mode’s typed Guard into Box<dyn Any + Send> so the dispatcher can stash heterogeneous Guards in a single GuardStore and drop them on deactivation.
Mode
Declarative mode contract.

Type Aliases§

LifecycleFuture
Pinned, boxed, send-able future for Mode::on_activate.