Table of Contents

Struct MailRuleSetRevision

Namespace
MailFathom.Application.Rules
Assembly
MailFathom.Application.dll

Identifies the rule set a pass ran under, as a digest of the rules themselves in the order they were declared.

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

Remarks

Derived rather than declared, which is what makes it trustworthy: an authored version key can be forgotten, and an edit that changes the rules while leaving the key alone is exactly the case a history has to be able to tell apart. A publication counter was the other candidate and is worse for the opposite reason — it is process-local, so it restarts at zero and means something different on every replica, while two instances reading the same file must name the same revision.

The digest is taken over the bound rules, so it does not move for the wrong reasons: a change to an unrelated configuration key leaves it alone, and so does reformatting the file or reordering the keys within one rule. Reordering the rules themselves does move it, because declared order is part of what a rule set means. So is the scope: narrowing a rule to one account changes which mail it reaches, which is a different rule set rather than the same one applied differently. So are the triggers, for the same reason — a rule withdrawn from firing on arrival reaches different mail from the one that fires on it — and so is the schedule beside them, because moving when a rule walks a mailbox is moving which mail it reaches at any moment. So are the actions, for the reason the revision is part of a request's identity at all — a rule now filing into a different folder must ask afresh rather than be answered by the record of the filing it asked for before the edit.

It carries none of the authored text and no ordering. A record naming a revision therefore holds nothing personal that the condition contributed, and a record that has to say which of two revisions came first carries its own timestamp rather than inferring one from the value.

Properties

IsSpecified

Gets whether this value names a revision rather than the unusable struct default.

Value

Gets the identity, as lowercase hexadecimal.

Methods

ContainsSeparator(string?)

Reports whether a value carries a character this identity separates its own fields with.

Create(IReadOnlyList<MailRuleDeclaration>)

Derives the identity of a rule set from the rules it declares, in the order it declares them.

Restore(string)

Reads back an identity this system derived earlier and recorded.

ToString()

Returns the fully qualified type name of this instance.