Table of Contents

Struct EmailTimelinePosition

Namespace
MailFathom.Domain.Emails
Assembly
MailFathom.Domain.dll

Places one stored email in the total order a mailbox timeline is read and paged over.

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

Remarks

Keyset pagination needs a total order, not merely a sort: two pages are contiguous only when every row falls on exactly one side of the key the previous page ended on. A received timestamp alone is not total, because a mail server can record several messages within the same instant, so the local identity is part of the position rather than a decoration on it.

This type is the single statement of that order. The timeline indexes on stored_emails are configured to match it column for column, so a query planned against the index returns rows in the order NewestFirst describes rather than in one that merely resembles it.

Constructors

EmailTimelinePosition(DateTimeOffset?, StoredEmailId)

Places one stored email in the total order a mailbox timeline is read and paged over.

Properties

NewestFirst

Gets the comparer that orders positions the way a mailbox timeline is read: newest message first.

OldestFirst

Gets the comparer that reads the same timeline from its other end: oldest message first.

ReceivedAt

When the last receiving hop recorded the message, or null when no header carried a usable date.

StoredEmailId

The stable local identity that breaks ties between messages sharing a timestamp.

Methods

ComparerFor(EmailTimelineDirection)

Gets the comparer that realizes one reading direction of the timeline.