Table of Contents

Struct KeysetCursorPayload

Namespace
MailFathom.Application.Paging
Assembly
MailFathom.Application.dll

Carries what every keyset cursor here encodes: an ordering position, the row at it, and a filter fingerprint.

public readonly record struct KeysetCursorPayload : IEquatable<KeysetCursorPayload>
Implements
Inherited Members

Remarks

Each paged reading declares a cursor of its own, because the position it walks and the identity that breaks a tie are its own domain types and its own words. What none of them owns is the encoding: the field layout, the version that leads it, the length bound applied before a byte is decoded, and the tick form an instant is written in are one decision, and a defect in any of them is a page served twice or skipped on every surface at once.

The format version is shared as well, which is what writing the codec once costs: a later change to the layout retires the cursors of every family together rather than one family at a time. That is the intended trade — a cursor is opaque and short-lived, and a version that drifted per family is one nobody could reason about.

ContactCursor is deliberately outside this. It orders by a name's comparison form rather than by an instant, carries no fingerprint, and lets its last field hold the separator: a different format that happens to be base64url, not another copy of this one.

The payload carries no secret and needs no signature, because every value in it is one the caller already supplied or already received. Encoding is about opacity rather than protection — a client that cannot read a cursor does not build one, and a built cursor is how a caller would ask for a boundary this system never computed.

Fields

MaximumEncodedLength

The greatest number of characters an encoded cursor may carry before it is refused unread.

Properties

FilterFingerprint

Gets the fingerprint of the filters the cursor was issued for.

Identity

Gets the identity of the row at that position, which breaks a tie between two sharing an instant.

Position

Gets the instant the page ended on, or null when no instant orders that row.

Methods

At(DateTimeOffset?, Guid, string)

Creates the payload one page boundary encodes to.

Encode()

Writes the payload as the opaque string a caller presents to continue the walk.

TryDecode(string?, out KeysetCursorPayload)

Reads the payload out of the text a caller presented.