Struct leptos_reactive::suspense::SuspenseContext
source · pub struct SuspenseContext {
pub pending_resources: ReadSignal<usize>,
/* private fields */
}
Expand description
Fields§
§pending_resources: ReadSignal<usize>
The number of resources that are currently pending.
Implementations§
source§impl SuspenseContext
impl SuspenseContext
sourcepub fn has_local_only(&self) -> bool
pub fn has_local_only(&self) -> bool
Whether the suspense contains local resources at this moment, and therefore can’t be serialized
sourcepub fn has_any_local(&self) -> bool
pub fn has_any_local(&self) -> bool
Whether the suspense contains any local resources at this moment.
sourcepub fn should_block(&self) -> bool
pub fn should_block(&self) -> bool
Whether any blocking resources are read under this suspense context, meaning the HTML stream should not begin until it has resolved.
sourcepub fn to_future(&self) -> impl Future<Output = ()>
pub fn to_future(&self) -> impl Future<Output = ()>
Returns a Future
that resolves when this suspense is resolved.
sourcepub fn none_pending(&self) -> bool
pub fn none_pending(&self) -> bool
Reactively checks whether there are no pending resources in the suspense.
source§impl SuspenseContext
impl SuspenseContext
sourcepub fn increment(&self, serializable: bool)
pub fn increment(&self, serializable: bool)
Notifies the suspense context that a new resource is now pending.
sourcepub fn decrement(&self, serializable: bool)
pub fn decrement(&self, serializable: bool)
Notifies the suspense context that a resource has resolved.
sourcepub fn decrement_for_resource(&self, serializable: bool, resource: ResourceId)
pub fn decrement_for_resource(&self, serializable: bool, resource: ResourceId)
Notifies the suspense context that a resource has resolved.
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 Default for SuspenseContext
impl Default for SuspenseContext
source§impl Hash for SuspenseContext
impl Hash for SuspenseContext
source§impl PartialEq for SuspenseContext
impl PartialEq for SuspenseContext
impl Copy for SuspenseContext
impl Eq 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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.