pub struct Page {
pub header: String,
pub body: String,
pub total_matches: usize,
pub total_files: usize,
pub first_index: usize,
pub last_index: usize,
pub last_key: Option<(String, u64)>,
pub has_more: bool,
pub fingerprint: u64,
}Expand description
A rendered page: surface-agnostic header + body, plus the counts and keyset state each caller
(CLI / MCP) needs to mint the “next page” cursor and detect a changed result set.
Fields§
§header: String§body: String§total_matches: usize§total_files: usize§first_index: usize1-based index of the first/last entry on this page (in matches, or files for -l/-c); 0 when
empty.
last_index: usize§last_key: Option<(String, u64)>Keyset key of the last rendered entry, to seed the next cursor; None when nothing remains.
has_more: bool§fingerprint: u64Fingerprint of the full result set, for staleness detection across pages.
Implementations§
Source§impl Page
impl Page
Sourcepub fn next_cursor(
&self,
mode: Mode,
pattern: String,
opts: SearchOptions,
page_size: usize,
root_hint: Option<String>,
) -> Option<Cursor>
pub fn next_cursor( &self, mode: Mode, pattern: String, opts: SearchOptions, page_size: usize, root_hint: Option<String>, ) -> Option<Cursor>
The cursor that fetches the page after this one, or None when this is the last page. Both the
CLI and MCP surfaces mint it the same way; root_hint is the only per-surface input (the
resolved root for the CLI, None for MCP where the server root is authoritative).
Sourcepub fn staleness_note(&self, prev: Option<(usize, u32)>) -> Option<String>
pub fn staleness_note(&self, prev: Option<(usize, u32)>) -> Option<String>
A note for the caller to surface when resuming a cursor whose result set has since changed
(fingerprint mismatch), or None. prev is the cursor’s (prev_total, fingerprint); the
fingerprint is the low 32 bits, so compare against this page’s truncated to match.
Auto Trait Implementations§
impl Freeze for Page
impl RefUnwindSafe for Page
impl Send for Page
impl Sync for Page
impl Unpin for Page
impl UnsafeUnpin for Page
impl UnwindSafe for Page
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
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>
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>
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