Skip to main content

HistoryRunner

Trait HistoryRunner 

Source
pub trait HistoryRunner {
Show 13 methods // 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 submit_step_probe(&mut self, request: StepProbeRequest); fn poll_step_probe(&mut self) -> Option<StepProbeReply>; 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 { ... } fn poll_progress(&mut self) -> Option<RunProgress> { ... } fn cancel(&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 submit_step_probe(&mut self, request: StepProbeRequest)

Submit a STEP product-structure probe (see StepProbeRequest).

Source

fn poll_step_probe(&mut self) -> Option<StepProbeReply>

Non-blocking: the next completed STEP probe, 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.

Source

fn poll_progress(&mut self) -> Option<RunProgress>

Non-blocking: the MOST RECENT progress report of the in-flight run, with any older ones discarded (only the latest feature matters). None for a synchronous runner — Inline has finished before anyone could ask.

Source

fn cancel(&mut self) -> bool

ABANDON the in-flight work and start over with an EMPTY resident registry. Returns false when there is nothing this runner can abandon (Inline: the run already completed on the caller’s thread). A true means every handle the caller holds is now invalid, no reply is coming for anything submitted so far, and the parts library must be re-sent — the caller reconciles its generations and pending sets accordingly (EngineState::cancel_run). Nothing inside a feature is interruptible: the thread runner lets its old thread finish the feature it is on and stop at the next boundary; the browser worker is terminated outright.

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.