pub struct CachedCopyCheck { /* private fields */ }Expand description
The other check on open: an assembly’s embedded copies of PLM parts are a
cache of their revisions (crate::plm::cached_copies). Each PLM document
is compared once, when it opens; the copies older than their revisions are
replaced as part of the open (crate::document::Document::absorb_open_write:
not an unsaved change), with one notice naming them.
And while it is open: when the change feed names a revision an open
document embeds, at any depth (Self::moved), it is compared again. The
copies the user has not edited follow their revisions, through the chain
(a part saved elsewhere refreshes the sub that holds it), in the document
and its clean baseline alike, so the refresh is no unsaved change of its
own. A copy the user edited is never replaced unasked: the pane asks, Keep
my edits (the default) or Take their version. Never while a write of ours
is in flight: the feed names our own keys before their writes land.
Implementations§
Source§impl CachedCopyCheck
impl CachedCopyCheck
pub fn new() -> Self
Sourcepub fn sync(
&mut self,
client: &Rc<PlmClient>,
store: &dyn ModelStore,
docs: &mut Documents,
waker: &Waker,
writing: bool,
)
pub fn sync( &mut self, client: &Rc<PlmClient>, store: &dyn ModelStore, docs: &mut Documents, waker: &Waker, writing: bool, )
Once a frame: start a read of the revisions each newly opened PLM document’s copies name, and apply the answers.
Sourcepub fn recheck(&mut self, id: u64)
pub fn recheck(&mut self, id: u64)
Tab id was reloaded from its stored document: compare its copies
again, as on open (the earlier check’s refresh went with the reload).
Sourcepub fn moved(&mut self, docs: &Documents, keys: &[String], stale: bool)
pub fn moved(&mut self, docs: &Documents, keys: &[String], stale: bool)
The feed moved: every open document that embeds a revision it named (every checked one when it could not say which) is due a live check.
Sourcepub fn asking(&self, id: u64) -> Option<&[String]>
pub fn asking(&self, id: u64) -> Option<&[String]>
The edited copies the pane asks about for document id.
Sourcepub fn answer(&mut self, docs: &mut Documents, id: u64, take_theirs: bool)
pub fn answer(&mut self, docs: &mut Documents, id: u64, take_theirs: bool)
The answer for document id: true takes their version of the edited
copies (the edits in them are discarded), false keeps the edits
(asked again only when the PLM moves again).
pub fn busy(&self) -> bool
Sourcepub fn live_json(&self, id: u64) -> Value
pub fn live_json(&self, id: u64) -> Value
Live state for automation: refreshes so far, and the copies asked about.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for CachedCopyCheck
impl !Send for CachedCopyCheck
impl !Sync for CachedCopyCheck
impl !UnwindSafe for CachedCopyCheck
impl Forget for CachedCopyCheck
impl Freeze for CachedCopyCheckwhere
*const u8 is !null: Freeze,
PhantomData<(u64, ())>: Freeze,
PhantomData<(u64, Pending<HashMap<String, Value>>)>: Freeze,
PhantomData<(u64, usize)>: Freeze,
PhantomData<(u64, Vec<String>)>: Freeze,
PhantomData<(u64, (Vec<String>, HashMap<String, Value>))>: Freeze,
PhantomData<(u64, HashMap<String, String>)>: Freeze,
impl Move for CachedCopyCheck
impl Unpin for CachedCopyCheck
impl UnsafeUnpin for CachedCopyCheckwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<(u64, ())>: UnsafeUnpin,
PhantomData<(u64, Pending<HashMap<String, Value>>)>: UnsafeUnpin,
PhantomData<(u64, usize)>: UnsafeUnpin,
PhantomData<(u64, Vec<String>)>: UnsafeUnpin,
PhantomData<(u64, (Vec<String>, HashMap<String, Value>))>: UnsafeUnpin,
PhantomData<(u64, HashMap<String, String>)>: UnsafeUnpin,
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> 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.