Struct EmailTimelineCursor
- Namespace
- MailFathom.Application.Emails.Mailboxes
- Assembly
- MailFathom.Application.dll
Marks where one page of a mailbox timeline ended, so the next page continues from it.
public readonly record struct EmailTimelineCursor : IEquatable<EmailTimelineCursor>
- Implements
- Inherited Members
Remarks
The cursor pairs the timeline position the last returned row occupied with a fingerprint of the filters it was issued for. The position is what makes pagination keyset-based rather than offset-based: the next page asks for rows beyond a known boundary, so mail arriving between two requests neither shifts a window nor causes a row to be skipped or repeated. The fingerprint is what makes the boundary meaningful — a position names a page edge only within the filtered set and reading direction it was computed for.
It carries no secret and needs no signature, because every value in it is one the caller already supplied or already received: a received timestamp, a local identifier, and a hash of the filters they wrote. Encoding it is about opacity rather than protection — a client that cannot read a cursor cannot build one, and building one is how a caller would end up asking 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 and reading direction this cursor was issued for.
- Position
Gets the timeline position the page ended on, which the next page reads beyond.
Methods
- After(EmailTimelinePosition, string)
Creates the cursor that continues a walk after one timeline position.
- Encode()
Writes the cursor as the opaque string a caller presents to continue the walk.
- TryDecode(string?, out EmailTimelineCursor)
Reads a cursor a caller presented.