Struct MailFolderReference
- Namespace
- MailFathom.Domain.Folders
- Assembly
- MailFathom.Domain.dll
Names one folder of an account, either by the alias configuration gave it or by the role it plays.
public readonly record struct MailFolderReference : IEquatable<MailFolderReference>
- Implements
- Inherited Members
Remarks
This is what a caller writes wherever a folder is named — a rule's destination, a folder filter a tool argument carries — so that naming the junk folder does not oblige every deployment to agree on what it called that folder. Which mapping a reference means is an account's question rather than this type's, so nothing here resolves one.
The written form is the alias itself, or the role behind the role: prefix — the same
<scheme>:<target> shape a secret reference is written in. The prefix is what keeps the two
unambiguous: an alias may legitimately read Junk, and without a marker a deployment that renamed its alias
would silently start meaning the role instead.
Being a struct, default is reachable and names no folder at all. IsSpecified reports that, and every factory here produces a specified value, so the default can only arrive from code that declared a field and never assigned it.
Fields
- RoleScheme
The scheme that marks the text after it as a role rather than as an alias.
Properties
- IsSpecified
Gets whether this value names a folder rather than being the unusable struct default.
Methods
- Create(string)
Reads the text a caller named a folder with.
- ToAlias(MailFolderAlias)
Names the folder configuration gave that alias.
- ToRole(MailFolderSpecialUse)
Names whichever folder of the account plays that role.
- ToString()
Returns the reference in the form it is written in, so a message names it back the way a caller wrote it.
- TryCreate(string?, out MailFolderReference)
Reads the text a caller named a folder with, without raising on text that names none.