pub struct SuspenseHandle<T: Clone + PartialEq + 'static> { /* private fields */ }Expand description
A handle that drives a SuspenseState.
Created via SuspenseHandle::new(). The handle owns
the underlying Signal<SuspensePhase<T>> and exposes
state() to read it. The handle itself is the only
thing that can mutate the phase, via
resolve_sync (every target) or resolve_async
(wasm-only).
Implementations§
Source§impl<T: Clone + PartialEq + 'static> SuspenseHandle<T>
impl<T: Clone + PartialEq + 'static> SuspenseHandle<T>
Sourcepub fn resolve_sync(&self, value: T)
pub fn resolve_sync(&self, value: T)
Transitions the phase to Resolved(value). Works
on every target.
§Arguments
T: Clone + PartialEq + 'static- A generic type parameter.
Source§impl<T: Clone + PartialEq + 'static> SuspenseHandle<T>
impl<T: Clone + PartialEq + 'static> SuspenseHandle<T>
pub fn get_phase(&self) -> &Signal<SuspensePhase<T>>
pub fn get_mut_phase(&mut self) -> &mut Signal<SuspensePhase<T>>
pub fn set_phase(&mut self, val: Signal<SuspensePhase<T>>) -> &mut Self
Trait Implementations§
Source§impl<T: Clone + Clone + PartialEq + 'static> Clone for SuspenseHandle<T>
impl<T: Clone + Clone + PartialEq + 'static> Clone for SuspenseHandle<T>
Source§fn clone(&self) -> SuspenseHandle<T>
fn clone(&self) -> SuspenseHandle<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Clone + PartialEq + 'static> Default for SuspenseHandle<T>
impl<T: Clone + PartialEq + 'static> Default for SuspenseHandle<T>
Source§fn default() -> Self
fn default() -> Self
Constructs a default SuspenseHandle value.
Auto Trait Implementations§
impl<T> Freeze for SuspenseHandle<T>
impl<T> RefUnwindSafe for SuspenseHandle<T>
impl<T> Send for SuspenseHandle<T>
impl<T> Sync for SuspenseHandle<T>
impl<T> Unpin for SuspenseHandle<T>
impl<T> UnsafeUnpin for SuspenseHandle<T>
impl<T> UnwindSafe for SuspenseHandle<T>
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