pub struct Page<T> {
pub items: Vec<T>,
pub has_more: bool,
pub total_count: Option<u64>,
pub next_request_offset: Option<u32>,
}Expand description
A single page of results returned by a server function.
T is the item type (e.g. NotificationDto). The struct derives
Serialize and Deserialize so it crosses the Leptos server boundary
transparently.
has_more—truewhen more items exist beyond this page.total_count— optionally present on the first page (offset == 0) to give the client the full result-set size without a separate call.
Fields§
§items: Vec<T>The items in this page.
has_more: boolWhether additional pages exist after this one.
total_count: Option<u64>Total number of matching items (typically provided only on the first page to avoid repeated count queries).
next_request_offset: Option<u32>When set, the next (offset, limit) fetch should use this value as
offset instead of accumulated_items.len().
Use when the server applies offset/limit at the database row
layer but returns fewer items after filtering (e.g. resolving a
join skips some rows). Without this, the client would skip the wrong
slice and can show a short first page plus a premature “end of list”.
Implementations§
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for Page<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Page<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<T: Eq> Eq for Page<T>
impl<T: PartialEq> StructuralPartialEq for Page<T>
Auto Trait Implementations§
impl<T> Freeze for Page<T>
impl<T> RefUnwindSafe for Page<T>where
T: RefUnwindSafe,
impl<T> Send for Page<T>where
T: Send,
impl<T> Sync for Page<T>where
T: Sync,
impl<T> Unpin for Page<T>where
T: Unpin,
impl<T> UnsafeUnpin for Page<T>
impl<T> UnwindSafe for Page<T>where
T: UnwindSafe,
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