pub struct InfiniteQueryResult<T> {
pub pages: RwSignal<Vec<Page<T>>>,
pub current_page: RwSignal<usize>,
pub has_next: RwSignal<bool>,
pub has_prev: RwSignal<bool>,
pub is_loading: RwSignal<bool>,
pub error: RwSignal<Option<QueryError>>,
pub is_stale: RwSignal<bool>,
pub is_fetching: RwSignal<bool>,
pub key: QueryKey,
pub observer_id: QueryObserverId,
/* private fields */
}Expand description
Infinite query result with pagination support
Fields§
§pages: RwSignal<Vec<Page<T>>>All pages of data
current_page: RwSignal<usize>Current page number
has_next: RwSignal<bool>Whether more data can be loaded
has_prev: RwSignal<bool>Whether previous data exists
is_loading: RwSignal<bool>Loading state
error: RwSignal<Option<QueryError>>Error state
is_stale: RwSignal<bool>Whether data is stale
is_fetching: RwSignal<bool>Whether currently fetching
key: QueryKeyQuery key
observer_id: QueryObserverIdObserver ID
Implementations§
Source§impl<T> InfiniteQueryResult<T>
impl<T> InfiniteQueryResult<T>
Sourcepub async fn fetch_next_page(&self) -> Result<(), QueryError>
pub async fn fetch_next_page(&self) -> Result<(), QueryError>
Get the next page of data
Sourcepub async fn fetch_previous_page(&self) -> Result<(), QueryError>
pub async fn fetch_previous_page(&self) -> Result<(), QueryError>
Get the previous page of data
Sourcepub async fn refetch(&self) -> Result<(), QueryError>
pub async fn refetch(&self) -> Result<(), QueryError>
Refetch all pages
Sourcepub async fn invalidate(&self) -> Result<(), QueryError>
pub async fn invalidate(&self) -> Result<(), QueryError>
Invalidate and refetch
Sourcepub async fn remove(&self) -> Result<(), QueryError>
pub async fn remove(&self) -> Result<(), QueryError>
Remove all pages from cache
Sourcepub fn get_all_data(&self) -> Vec<T>
pub fn get_all_data(&self) -> Vec<T>
Get all data from all pages as a flat vector
Sourcepub fn get_page_data(&self, page: usize) -> Option<Vec<T>>
pub fn get_page_data(&self, page: usize) -> Option<Vec<T>>
Get data from a specific page
Sourcepub fn get_total_count(&self) -> usize
pub fn get_total_count(&self) -> usize
Get the total number of items across all pages
Trait Implementations§
Source§impl<T: Clone> Clone for InfiniteQueryResult<T>
impl<T: Clone> Clone for InfiniteQueryResult<T>
Source§fn clone(&self) -> InfiniteQueryResult<T>
fn clone(&self) -> InfiniteQueryResult<T>
Returns a duplicate 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 moreAuto Trait Implementations§
impl<T> Freeze for InfiniteQueryResult<T>
impl<T> !RefUnwindSafe for InfiniteQueryResult<T>
impl<T> Send for InfiniteQueryResult<T>
impl<T> Sync for InfiniteQueryResult<T>
impl<T> Unpin for InfiniteQueryResult<T>
impl<T> !UnwindSafe for InfiniteQueryResult<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> SerializableKey for T
impl<T> SerializableKey for T
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.