Table of Contents

Struct EmailThreadCursor

Namespace
MailFathom.Application.Emails.BrowseThread
Assembly
MailFathom.Application.dll

Marks the message one page of a conversation ended on, so the next page continues after it.

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

Remarks

The boundary is a message rather than a position, and that is the whole design. A conversation's order is derived on every read from the reply relation and the sent times, so an offset into it names nothing once a reply arrives in the middle — while the message a page ended on is still the same message, wherever the new arrival pushed it. The next page is what follows that message in the order the read just derived.

The fingerprint is of the conversation the cursor was issued for, which is what a conversation has instead of the filter set a timeline cursor carries: a thread is read by membership, so the only thing a boundary here can belong to is the thread it was taken in. A cursor presented against a different conversation is refused rather than resolved.

The encoded form is KeysetCursorPayload's, which every keyset cursor here shares. Its position field is written absent, because the place a message holds in a conversation is not an instant: the sent time settles messages answering the same parent and orders nothing on its own, so a boundary written as one would name a different message than the one the page ended on.

Properties

StoredEmailId

Gets the message the page ended on, which the next page reads beyond.

ThreadFingerprint

Gets the fingerprint of the conversation this cursor was issued for.

Methods

After(StoredEmailId, string)

Creates the cursor that continues a conversation after one message.

Encode()

Writes the cursor as the opaque string a caller presents to continue the conversation.

FingerprintOf(EmailThreadId)

Reduces one conversation to the fingerprint its cursors carry.

TryDecode(string?, out EmailThreadCursor)

Reads a cursor a caller presented.