pub struct SuspenseContext { /* private fields */ }
Expand description
A context with information about suspended components
Implementations§
source§impl SuspenseContext
impl SuspenseContext
sourcepub fn under_suspense_boundary<O>(
&self,
runtime: &Runtime,
f: impl FnOnce() -> O,
) -> O
pub fn under_suspense_boundary<O>( &self, runtime: &Runtime, f: impl FnOnce() -> O, ) -> O
Run a closure under a suspense boundary
sourcepub fn in_suspense_placeholder<O>(
&self,
runtime: &Runtime,
f: impl FnOnce() -> O,
) -> O
pub fn in_suspense_placeholder<O>( &self, runtime: &Runtime, f: impl FnOnce() -> O, ) -> O
Run a closure under a suspense placeholder
sourcepub fn downcast_suspense_boundary_from_scope(
runtime: &Runtime,
scope_id: ScopeId,
) -> Option<SuspenseContext>
pub fn downcast_suspense_boundary_from_scope( runtime: &Runtime, scope_id: ScopeId, ) -> Option<SuspenseContext>
Try to get a suspense boundary from a scope id
source§impl SuspenseContext
impl SuspenseContext
sourcepub fn suspended_nodes(&self) -> Option<VNode>
pub fn suspended_nodes(&self) -> Option<VNode>
Get the suspense boundary’s suspended nodes
sourcepub fn freeze(&self)
pub fn freeze(&self)
Resolve the suspense boundary on the server and freeze it to prevent future reruns of any child nodes of the suspense boundary
sourcepub fn has_suspended_tasks(&self) -> bool
pub fn has_suspended_tasks(&self) -> bool
Check if there are any suspended tasks
sourcepub fn is_suspended(&self) -> bool
pub fn is_suspended(&self) -> bool
Check if the suspense boundary is currently rendered as suspended
sourcepub fn suspended_futures(&self) -> Ref<'_, [SuspendedFuture]>
pub fn suspended_futures(&self) -> Ref<'_, [SuspendedFuture]>
Get all suspended tasks
sourcepub fn suspense_placeholder(&self) -> Option<Result<VNode, RenderError>>
pub fn suspense_placeholder(&self) -> Option<Result<VNode, RenderError>>
Get the first suspended task with a loading placeholder
Trait Implementations§
source§impl Clone for SuspenseContext
impl Clone for SuspenseContext
source§fn clone(&self) -> SuspenseContext
fn clone(&self) -> SuspenseContext
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SuspenseContext
impl Debug for SuspenseContext
source§impl PartialEq for SuspenseContext
impl PartialEq for SuspenseContext
Auto Trait Implementations§
impl Freeze for SuspenseContext
impl !RefUnwindSafe for SuspenseContext
impl !Send for SuspenseContext
impl !Sync for SuspenseContext
impl Unpin for SuspenseContext
impl !UnwindSafe for SuspenseContext
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.