Skip to main content

Module scan_task

Module scan_task 

Source
Expand description

OM.A1 — the per-plugin actor bridge for scanned-excerpt-source providers.

The agenda analogue of media_task.rs, and deliberately its near-twin: a dedicated async task owns the plugin’s Store<PluginState> for life (the Store is !Sync), an [ScanCall] crosses an mpsc channel with a oneshot reply, and the Send + Sync ScanClient serialises calls onto the single-consumer loop.

The serialisation is load-bearing here, not incidental. begin drops per-scan state and every following scan reads it, so the two must not interleave with a second scan’s calls. One actor, one queue, in order — which is also why the scan walks files sequentially rather than fanning out across the pool.

This is the fifth near-copy of the picker / completion / decoration / media actor. The rule-of-three note in completion_task is now well past earned; generalising over the bindings type is worth doing the next time one of them changes shape, and this slice deliberately did not take that on mid-seam.

Structs§

Annotation
HB.5: the row an Entry hangs below itself. HB.5: one line hung below a row, and how it is coloured.
ClockSpan
OA.14b: a file’s clocked time, reported beside its rows. OA.14b: time clocked on one headline on one day.
DisplaySpan
OA.5: the per-row style spans an Entry carries. PS.1: a styled run of a candidate’s display text.
Entry
The WIT entry, re-exported so the adapter and the loader name one type. One agenda row the guest recognised in a file.
ScanActor
The per-plugin actor: owns the Store + agenda bindings for the plugin’s life and serves calls off the channel until every ScanClient drops.
ScanClient
The Send + Sync handle a caller holds. Cloning is cheap; every clone talks to the same actor / Store, so calls serialise on the single-consumer loop the !Sync Store requires — which is exactly what begin-then-scan needs.
ScanResult
OA.14b: a file’s clocked time, reported beside its rows. What one file’s scan produced.