pub enum LayerState<T> {
Clean,
Populated(T),
ScanFailed,
}Expand description
Per-layer scan state. Replaces the earlier parallel-bool encoding
(Option<T> paired with a *_scan_ok: bool) so the three legal
states are unrepresentable as illegal combinations.
Clean- the layer ran cleanly with nothing to report (clean worktree, branch at merge-base, on the default branch, detached HEAD with no base, or not in a repo at all).Populated(T)- the layer ran and produced data the renderer should show.ScanFailed- the underlying subprocess crashed, timed out, or exceeded the stdout cap. The renderer surfaces a “(scan failed)” stub so the user sees the failure rather than a silent clean-tree render.
Serialised as the socket’s record shape for the bounded content read, whose layers answer in the same three states the scanner’s do.
Variants§
Implementations§
Source§impl<T> LayerState<T>
impl<T> LayerState<T>
Sourcepub fn is_populated(&self) -> bool
pub fn is_populated(&self) -> bool
True when the layer has data the renderer should show.
Trait Implementations§
Source§impl<T: Clone> Clone for LayerState<T>
impl<T: Clone> Clone for LayerState<T>
Source§impl<T: Debug> Debug for LayerState<T>
impl<T: Debug> Debug for LayerState<T>
Source§impl<'de, T> Deserialize<'de> for LayerState<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for LayerState<T>where
T: Deserialize<'de>,
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>,
Deserialize this value from the given Serde deserializer. Read more
impl<T: Eq> Eq for LayerState<T>
Source§impl<T: PartialEq> PartialEq for LayerState<T>
impl<T: PartialEq> PartialEq for LayerState<T>
Source§impl<T> Serialize for LayerState<T>where
T: Serialize,
impl<T> Serialize for LayerState<T>where
T: Serialize,
impl<T: PartialEq> StructuralPartialEq for LayerState<T>
Auto Trait Implementations§
impl<T> Freeze for LayerState<T>where
T: Freeze,
impl<T> RefUnwindSafe for LayerState<T>where
T: RefUnwindSafe,
impl<T> Send for LayerState<T>where
T: Send,
impl<T> Sync for LayerState<T>where
T: Sync,
impl<T> Unpin for LayerState<T>where
T: Unpin,
impl<T> UnsafeUnpin for LayerState<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for LayerState<T>where
T: 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
key and return true if they are equal.