//! Cursor-paginated lists.
use serde::{Deserialize, Serialize};
use crate::types::PageCursor;
/// One page of a history or list, newest first.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct Page<T> {
/// The items.
pub data: Vec<T>,
/// The cursor of the next (older) page, with the same filters; `None` on the last page.
#[serde(deserialize_with = "super::required")]
pub next_cursor: Option<PageCursor>,
/// Whether another page follows.
pub has_more: bool,
}
#[cfg(test)]
mod tests;