Skip to main content

Module executor

Module executor 

Source
Expand description

The async executor seam: who runs a crate::scan::ScanRequest and how the result re-enters the reactive cycle.

DirectoryTree transitions stay pure — they never spawn tasks, never touch a runtime. When a scan is needed, DirectoryTree::on_toggled returns a crate::scan::ScanRequest as data. The embedding layer (a Dioxus coroutine, the ThreadExecutor default, or a test) passes that request to an executor and feeds the resulting crate::scan::LoadPayload back through DirectoryTree::on_loaded.

§Object safety and pluggability (S5.1)

ScanExecutor is object-safe and usable behind Arc<dyn ScanExecutor>. High-throughput applications (heavy prefetch, RFC 009) can plug in a tokio::task::spawn_blocking-based or rayon-based executor without touching the tree state machine.

Structs§

ThreadExecutor
Default executor: spawns one std::thread::spawn per scan (S5.3).

Traits§

ScanExecutor
The executor seam — pluggable off-thread scan execution (S5.1).

Type Aliases§

ScanFuture
The future returned by ScanExecutor::spawn_blocking.
ScanJob
A heap-allocated blocking job: no arguments, returns a LoadPayload.