Skip to main content

HistoryRunner

Trait HistoryRunner 

Source
pub trait HistoryRunner {
    // Required methods
    fn submit_run(&mut self, request: HistoryRequest, generation: u64);
    fn poll_run(&mut self) -> Option<RunReply>;
    fn submit_query(&mut self, query: MeasureQuery);
    fn poll_query(&mut self) -> Option<MeasureReply>;
    fn submit_mesh_import(&mut self, request: MeshImportRequest);
    fn poll_mesh_import(&mut self) -> Option<MeshImportReply>;
    fn reset(&mut self);

    // Provided methods
    fn sync_parts_library(
        &mut self,
        _revision: u64,
        _fetch: &mut dyn FnMut() -> PartsLibraryMap,
    ) { ... }
    fn poll_library_request(&mut self) -> bool { ... }
}
Expand description

The history-run seam: SUBMIT a run, POLL for its completed reply, RESET the delta baseline, plus a QUERY channel for per-object measurements (routed to the runner so the warm registry answers them, never the cold main-side one). The Inline impl runs everything synchronously; a later thread/worker impl defers the work and surfaces the replies through the same poll idiom.

Required Methods§

Source

fn submit_run(&mut self, request: HistoryRequest, generation: u64)

Submit a history run tagged with a monotonic generation. The runner executes it (immediately for Inline; on a background thread later) and makes the reply available via poll_run.

Source

fn poll_run(&mut self) -> Option<RunReply>

Non-blocking: the next completed run reply, if any (drained each frame).

Source

fn submit_query(&mut self, query: MeasureQuery)

Submit a per-object measurement query (answered against the runner’s warm registry). Inline computes it immediately; a thread impl computes it on the runner thread and surfaces it via poll_query.

Source

fn poll_query(&mut self) -> Option<MeasureReply>

Non-blocking: the next completed measurement reply, if any.

Source

fn submit_mesh_import(&mut self, request: MeshImportRequest)

Submit RANSAC mesh reconstruction to the runner’s thread/worker.

Source

fn poll_mesh_import(&mut self) -> Option<MeshImportReply>

Non-blocking: the next completed mesh reconstruction, if any.

Source

fn reset(&mut self)

Drop the delta baseline (document switch → full rebuild).

Provided Methods§

Source

fn sync_parts_library( &mut self, _revision: u64, _fetch: &mut dyn FnMut() -> PartsLibraryMap, )

Bring the runner’s resident PARTS LIBRARY up to revision, calling fetch ONLY when it is not already there. Called immediately before every submit_run.

This is the whole point of the library channel: the library is sent when it CHANGES (insert, document load, refresh), not on every run. Cheap to call — the revision comparison is an integer, and fetch (which clones the store) never runs in the steady state. The default is a no-op for InlineRunner, which shares the caller’s kernel store.

Source

fn poll_library_request(&mut self) -> bool

True when the runner REFUSED a run because its resident parts library could not serve it (see Reply::NeedPartsLibrary). It has already forgotten its copy, so the next sync_parts_library reinstalls; the caller must re-submit the run. Never true for a runner that shares the caller’s store.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl HistoryRunner for InlineRunner

Source§

impl HistoryRunner for ThreadRunner

Available on non-WebAssembly only.