pub struct UpdateComponents { /* private fields */ }Expand description
The shell-owned outdated-parts checker + batch refresher. One instance on the app; the constraints panel reads the count (and runs the refresh), the structure tree reads per-part flags.
Implementations§
Source§impl UpdateComponents
impl UpdateComponents
pub fn new() -> Self
Sourcepub fn ensure_current(
&mut self,
state: &mut EngineState,
model_store: &dyn ModelStore,
save_generation: u64,
synced: &HashMap<String, String>,
)
pub fn ensure_current( &mut self, state: &mut EngineState, model_store: &dyn ModelStore, save_generation: u64, synced: &HashMap<String, String>, )
Recompute the outdated/missing sets when the staleness key moved (or
after Self::invalidate); otherwise a cheap compare. The shell calls
this once per frame BEFORE the assembly panels draw.
synced: each top-level entry’s sourceSignature as of the tab’s last
Open/Save (crate::document::Documents::synced_signatures); empty
when unknown, and then the entry’s own signature stands alone.
Sourcepub fn asking(&self) -> Option<&[String]>
pub fn asking(&self) -> Option<&[String]>
The parts an Update is waiting to ask about (automation readback).
Sourcepub fn answer(
&mut self,
state: &mut EngineState,
model_store: &dyn ModelStore,
take_files: bool,
) -> Result<usize, String>
pub fn answer( &mut self, state: &mut EngineState, model_store: &dyn ModelStore, take_files: bool, ) -> Result<usize, String>
Answer the question Self::run asked and run the update: true
takes the files’ versions, false keeps this document’s edits (the
other outdated parts are updated either way).
Sourcepub fn show_conflict(
&mut self,
ctx: &Context,
state: &mut EngineState,
model_store: &dyn ModelStore,
)
pub fn show_conflict( &mut self, ctx: &Context, state: &mut EngineState, model_store: &dyn ModelStore, )
The question, while one is pending: one dialog, never a block. The default (Enter) takes the files’ versions.
Sourcepub fn invalidate(&mut self)
pub fn invalidate(&mut self)
Drop the cache so the next Self::ensure_current recomputes even on
an unmoved key (after a run, or an external store change).
Sourcepub fn outdated_count(&self) -> usize
pub fn outdated_count(&self) -> usize
The outdated-entry count — the constraints-header badge number.
Sourcepub fn outdated(&self) -> &[String]
pub fn outdated(&self) -> &[String]
The outdated entry names — what the Diagram and PCB workbenches mark on the components placed from them.
Sourcepub fn is_outdated(&self, part_name: &str) -> bool
pub fn is_outdated(&self, part_name: &str) -> bool
Whether part_name’s library entry is outdated — the structure tree’s
per-node badge (every instance of the part lights).
Sourcepub fn run(
&mut self,
state: &mut EngineState,
model_store: &dyn ModelStore,
) -> Result<usize, String>
pub fn run( &mut self, state: &mut EngineState, model_store: &dyn ModelStore, ) -> Result<usize, String>
RUN the update (the header button): recompute against the LIVE document
(never a stale cache), rewrite every outdated entry from its store
content through refresh_library_entry, then reload ONCE — the
kernel self-heals every instance + re-solves, and the main-side sync
captures healed snapshots back. Per-entry failures (missing store key,
unreadable content) toast and SKIP — the batch never aborts. Returns
the number of entries refreshed.
Trait Implementations§
Auto Trait Implementations§
impl Forget for UpdateComponents
impl Freeze for UpdateComponentswhere
*const u8 is !null: Freeze,
PhantomData<String>: Freeze,
PhantomData<(String, String)>: Freeze,
PhantomData<(String, BTreeSet<String>)>: Freeze,
PhantomData<(String, Verdict)>: Freeze,
impl Move for UpdateComponents
impl RefUnwindSafe for UpdateComponents
impl Send for UpdateComponents
impl Sync for UpdateComponents
impl Unpin for UpdateComponents
impl UnsafeUnpin for UpdateComponentswhere
*const u8 is !null: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<(String, String)>: UnsafeUnpin,
PhantomData<(String, BTreeSet<String>)>: UnsafeUnpin,
PhantomData<(String, Verdict)>: UnsafeUnpin,
impl UnwindSafe for UpdateComponentswhere
RawVecInner: UnwindSafe,
HashMap<String, String>: UnwindSafe,
HashMap<String, BTreeSet<String>>: UnwindSafe,
HashMap<String, Verdict>: UnwindSafe,
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.