pub trait SuspenseSignalExt<T, E> {
// Required method
fn suspend(&self) -> Result<Result<T, E>, RenderError>;
}Expand description
Extension trait to enable suspense support for provider signals
Allows you to call .suspend() on a Signal<ProviderState<T, E>>
inside a component. If the state is Loading, this will suspend
rendering and trigger Dioxus’s SuspenseBoundary fallback.
Usage:
let user = use_provider(fetch_user(), (1,)).suspend()?;Required Methods§
Sourcefn suspend(&self) -> Result<Result<T, E>, RenderError>
fn suspend(&self) -> Result<Result<T, E>, RenderError>
Returns Ok(data) if ready, Err(RenderError::Suspended) if loading, or Ok(Err(error)) if error.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".