pub enum Command {
Run {
request: HistoryRequest,
generation: u64,
parts_library_revision: u64,
},
SetPartsLibrary {
library: PartsLibraryMap,
revision: u64,
},
Query(MeasureQuery),
MeshImport(MeshImportRequest),
Reset,
}Expand description
A command sent main → runner (thread channel OR worker postMessage) over one
ordered stream (so a Reset before a Run stays before it). Run carries the
whole request; the driver coalesces consecutive Runs to shed a slider drag’s
backlog (the thread in thread_main, the worker’s main side in WorkerRunner).
Variants§
Run
Fields
request: HistoryRequestparts_library_revision: u64The brep_kernel::parts_library_revision this run was built
against. The runner refuses to execute a run stamped for a library
it does not hold — see process_command.
SetPartsLibrary
Install the parts library on the runner’s OWN kernel store. Sent only when the library actually changes (insert, document load, refresh), never per run: it carries the whole embedded-part payload, which for an imported STEP assembly is megabytes, and stringifying that on the browser’s main thread once per edit is what froze the UI.
Deliberately its OWN command rather than an optional field on Run:
both drivers COALESCE consecutive runs (see [thread_main] and
WorkerRunner::submit_run), so a library riding on a run could be
dropped with it. A SetPartsLibrary is never coalesced away, and the
stream is ordered, so it always lands before the run that needs it.
Query(MeasureQuery)
MeshImport(MeshImportRequest)
Reset
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Command
impl<'de> Deserialize<'de> for Command
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more