dioxus_lib::prelude

Trait SuspenseExtension

source
pub trait SuspenseExtension<T>: Sealed {
    // Required method
    fn with_loading_placeholder(
        self,
        display_placeholder: impl FnOnce() -> Result<VNode, RenderError>,
    ) -> Result<T, RenderError>;
}
Expand description

Provides context methods to Result<T, RenderError> to show loading indicators for suspended results

This trait is sealed and cannot be implemented outside of dioxus-core

Required Methods§

source

fn with_loading_placeholder( self, display_placeholder: impl FnOnce() -> Result<VNode, RenderError>, ) -> Result<T, RenderError>

Add a loading indicator if the result is suspended

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T> SuspenseExtension<T> for Result<T, RenderError>

source§

fn with_loading_placeholder( self, display_placeholder: impl FnOnce() -> Result<VNode, RenderError>, ) -> Result<T, RenderError>

Implementors§