Struct leptos::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 new() -> SuspenseContext
pub fn new() -> SuspenseContext
Creates an empty suspense context.
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§fn default() -> SuspenseContext
fn default() -> SuspenseContext
Returns the “default value” for a type. Read more
source§impl Hash for SuspenseContext
impl Hash for SuspenseContext
source§impl PartialEq for SuspenseContext
impl PartialEq for SuspenseContext
source§fn eq(&self, other: &SuspenseContext) -> bool
fn eq(&self, other: &SuspenseContext) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.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<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.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<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more