pub enum BuildState {
NotBuilt,
Cached,
Stale,
Building,
Failed,
}Expand description
PM.8a: how current a plugin’s built artifact is.
Answered from the .build-stamp PM.5 writes, so it survives a restart
like the source does. Only meaningful for a buildable source — there is no
such thing as a stale prebuilt or a stale bundled plugin, which is why
BuildState::NotBuilt exists rather than reporting those as Cached.
Variants§
NotBuilt
Nothing the editor builds: bundled, prebuilt, or an unknown source.
Cached
The artifact was built from the source as it stands.
Stale
The source has changed since the artifact was built. The plugin is running old code until the next build.
Building
A build is running right now.
The one state that is NOT derived from disk. Everything else here is a fact about files that outlives the process; this is a fact about the process, so it lives in memory and disappears with it — which is correct, because a build interrupted by a crash is not still running after a restart.
Failed
The last build attempted this session failed. The plugin is running whatever it was running before (or nothing, if it never built).
Also in-memory: on the next boot the artifact either exists — and the stamp says whether it is stale — or it does not. Persisting a failure would mean showing a user an error about a build they may since have fixed.
Implementations§
Trait Implementations§
Source§impl Clone for BuildState
impl Clone for BuildState
Source§fn clone(&self) -> BuildState
fn clone(&self) -> BuildState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BuildState
impl Debug for BuildState
impl Eq for BuildState
Source§impl PartialEq for BuildState
impl PartialEq for BuildState
impl StructuralPartialEq for BuildState
Auto Trait Implementations§
impl Freeze for BuildState
impl RefUnwindSafe for BuildState
impl Send for BuildState
impl Sync for BuildState
impl Unpin for BuildState
impl UnsafeUnpin for BuildState
impl UnwindSafe for BuildState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 more