Skip to main content

euv_ui/hook/suspense/
enum.rs

1/// The phase of a `SuspenseState`.
2///
3/// - `Pending` — the underlying data is still loading.
4///   Render a fallback / spinner.
5/// - `Resolved(T)` — the data has loaded.
6///   Render the loaded content.
7/// - `Failed(String)` — the data load failed with the
8///   given message. Render an error boundary.
9#[derive(Clone, Debug, Default)]
10pub enum SuspensePhase<T> {
11    /// The data is still loading.
12    #[default]
13    Pending,
14    /// The data has loaded.
15    Resolved(T),
16    /// The data load failed; the message is for
17    /// debugging.
18    Failed(String),
19}