pub struct EmptyState {
pub feed: String,
pub cause: Cause,
pub detail: String,
pub hint: String,
}Expand description
A pane’s named empty state: WHICH feed is empty, WHY, and (optionally) what fills it.
Construct it at the point the read comes back empty — the constructor takes the feed name and the cause, because a pane that cannot name its own feed has no business drawing an empty state for it.
Fields§
§feed: StringThe feed, named the way an operator would go look it up: an RPC path
(dwarf.v1/Dwarf.History), a warehouse table (mimir/binary_facts), a file
($DWARVES_FLEET_RUN). Never a vague noun like “the backend”.
cause: CauseWhy it produced nothing.
detail: StringThe concrete detail behind the cause — the endpoint that refused, the path that was absent, the row count that was zero. One line, plain words.
hint: StringOptional: the action that would fill the feed (a command, an env var to set).
Implementations§
Source§impl EmptyState
impl EmptyState
Sourcepub fn new(
feed: impl Into<String>,
cause: Cause,
detail: impl Into<String>,
) -> Self
pub fn new( feed: impl Into<String>, cause: Cause, detail: impl Into<String>, ) -> Self
A named empty state. feed and detail are both required — see the module note.
Sourcepub fn no_rows(feed: impl Into<String>, detail: impl Into<String>) -> Self
pub fn no_rows(feed: impl Into<String>, detail: impl Into<String>) -> Self
The feed was read and holds nothing (0 rows).
Sourcepub fn unreachable(feed: impl Into<String>, detail: impl Into<String>) -> Self
pub fn unreachable(feed: impl Into<String>, detail: impl Into<String>) -> Self
The feed could not be reached.
Sourcepub fn not_configured(
feed: impl Into<String>,
detail: impl Into<String>,
) -> Self
pub fn not_configured( feed: impl Into<String>, detail: impl Into<String>, ) -> Self
The feed is not wired in this build/config.
Sourcepub fn with_hint(self, hint: impl Into<String>) -> Self
pub fn with_hint(self, hint: impl Into<String>) -> Self
Add the action that would fill the feed.
Sourcepub fn ui(&self, ui: &mut Ui)
pub fn ui(&self, ui: &mut Ui)
Draw it. A dim glyph, the cause word, the feed name in monospace (it is a lookup key, so it is typeface-distinct from prose), the detail, and the hint. Nothing here is clickable and nothing is coloured green — an empty state that looks like a healthy result is the bug this component exists to prevent.
Sourcepub fn state_json(&self) -> Value
pub fn state_json(&self) -> Value
The oracle half — fold into the pane’s own state_json so a test can assert the
pane is in a NAMED empty state (and is therefore not painting sample rows).
Trait Implementations§
Source§impl Clone for EmptyState
impl Clone for EmptyState
Source§impl Debug for EmptyState
impl Debug for EmptyState
Source§impl<'de> Deserialize<'de> for EmptyState
impl<'de> Deserialize<'de> for EmptyState
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>,
impl Eq for EmptyState
Source§impl PartialEq for EmptyState
impl PartialEq for EmptyState
Source§impl Serialize for EmptyState
impl Serialize for EmptyState
impl StructuralPartialEq for EmptyState
Auto Trait Implementations§
impl Freeze for EmptyState
impl RefUnwindSafe for EmptyState
impl Send for EmptyState
impl Sync for EmptyState
impl Unpin for EmptyState
impl UnsafeUnpin for EmptyState
impl UnwindSafe for EmptyState
Blanket Implementations§
impl<T> Allocation for T
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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