Table of Contents

Struct SensitiveContentSpan

Namespace
MailFathom.Application.SensitiveContent.Detection
Assembly
MailFathom.Application.dll

Where in the analyzed text a finding sits, as a character offset and a length.

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

Remarks

A finding points at its text rather than carrying it. That is the whole reason this type exists: a record that held the matched value would recreate the leak in the object written to prevent it, and every consumer that logs, stores, or audits a finding would carry the credential along with it.

Offsets are into the text handed to the scanner, in UTF-16 code units, which is what indexing a string uses. Being a struct, default is reachable and describes no region; IsSpecified reports that, and Create(int, int) is the only route to a usable value.

Properties

End

Gets the offset just past the last character the finding covers.

IsSpecified

Gets whether this value describes a region rather than the unusable struct default.

Length

Gets the number of characters the finding covers, which is always at least one.

Start

Gets the offset of the first character the finding covers.

Methods

CoverWith(SensitiveContentSpan)

Produces the smallest span covering both this one and another.

Create(int, int)

Creates a span over a region of the analyzed text.

Overlaps(SensitiveContentSpan)

Reports whether this span shares at least one character with another.

ToString()

Returns the fully qualified type name of this instance.