Std.App.Page
11 public declarations
- decodeCursor
Str -> Result[Str, Std.App.Page.PageError]The key a cursor names.
- encodeCursor
Str -> StrAn opaque cursor for
key: URL-safe base64 without padding. - explain
&Std.App.Page.PageError -> StrA one-line description of a refusal.
- fromFetched
&Array[T] -> fn(T) -> Str -> &Std.App.Page.Request -> Std.App.Page.Page[T]A page built from a fetch that asked a store for
size + 1rows: the - linkHeader
Str -> &Std.App.Page.Page[T] -> &Std.App.Page.Request -> Option[(Str, Str)]The
Linkheader (RFC 8288) pointing at the next page, carrying the - Page
One page: its items and the cursor for the page after it, absent on the
- PageError
Why a page request was refused.
- request
&Map[Str, Str] -> Int -> Int -> Result[Std.App.Page.Request, Std.App.Page.PageError]Reads
limitandcursorfrom a query. - Request
What a client asked for: at most
sizeitems after the item whose key - select
&Array[T] -> fn(T) -> Str -> &Std.App.Page.Request -> Std.App.Page.Page[T]The page of
itemsa request selects. - toJson
&Std.App.Page.Page[T] -> fn(T) -> Std.Json.Json -> Std.Json.Json{"items": [...], "next": "..."}, withnextnull on the last page.
