Table of Contents

Struct MailboxMutation

Namespace
MailFathom.Domain.Mutations
Assembly
MailFathom.Domain.dll

Names one change MailFathom is permitted to make to a remote mailbox.

[JsonConverter(typeof(MailboxMutationJsonConverter))]
public readonly record struct MailboxMutation : IEquatable<MailboxMutation>
Implements
Inherited Members

Remarks

The type is a closed enumeration of values rather than a C# enum, because the name is the identity: it is what a log line records, what a span is called, and what a counter is broken down by, so an operator reading any of the three sees the same word. An enum member's ordinal would carry no meaning outside this assembly, and a name derived from the member would change with every rename of the operation it belongs to.

The set is closed because it is the answer to a decision rather than a list that grows with call sites. Sending, every flag other than \Seen, and folder management are refused, and permitting one of them is a decision to reopen rather than a member to append.

A mutation names what was asked for, never how the server was made to do it. A relocation carried by MOVE and a relocation carried by copy, flag, and expunge are the same value here, which is what lets the layer above be unable to tell them apart. Being a struct, default is reachable and names no mutation; IsSpecified reports that.

Properties

All

Gets every permitted mutation.

Copy

Gets the mutation that puts a second live occurrence of one email into another folder.

Delete

Gets the mutation that removes one email from the folder it is in.

IsSpecified

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

Name

Gets the name a log line, a span, and a counter dimension all use for the mutation.

Relocate

Gets the mutation that moves one email out of its folder and into another.

SetSeen

Gets the mutation that sets or clears the remote \Seen flag of one email.

Methods

ToString()

Returns the fully qualified type name of this instance.

TryParseName(string?, out MailboxMutation)

Parses a recorded name back into the mutation it names.