Trait freya::prelude::SuspenseExtension

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§

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§

§

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

§

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

Implementors§