resuma 0.4.7

Resuma — resumable SSR Rust web framework: zero hydration, islands, server actions, Flow (Axum).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! UI helpers for rendering errors without panicking.

use super::view::View;

/// Render `Ok` content or a fallback from a `Result` (e.g. mapped server action output).
pub fn error_boundary<E: AsRef<str>>(
    result: Result<View, E>,
    fallback: impl FnOnce(String) -> View,
) -> View {
    match result {
        Ok(v) => v,
        Err(e) => fallback(e.as_ref().to_string()),
    }
}