Table of Contents

Method GuardTextAsync

Namespace
MailFathom.Application.SensitiveContent.Derivation
Assembly
MailFathom.Application.dll

GuardTextAsync(MailAccountId, string, CancellationToken)

Redacts one text and reports where every placeholder ended up.

public Task<RedactedText> GuardTextAsync(MailAccountId account, string text, CancellationToken cancellationToken)

Parameters

account MailAccountId

The account whose mail the text was extracted from.

text string

The text to redact, which must be a value rather than a document composed around one.

cancellationToken CancellationToken

Cancels the scan.

Returns

Task<RedactedText>

The redaction, which is the text itself with no placement where nothing scans this account's mail.

Remarks

The same redaction GuardAsync(MailAccountId, string, CancellationToken) performs, handed back whole rather than as its text alone. A caller needs this where it holds offsets into the text it passed in — an attachment's page boundaries are the case it exists for — because a placeholder is shorter or longer than what it replaced, so every such offset past the first finding has moved.

Exceptions

ArgumentNullException

Thrown when text is null.

SensitiveContentScannerUnavailableException

Thrown when a switched-on scanner could not establish what the text carries, which refuses the derived write.

OperationCanceledException

Thrown when cancellationToken is cancelled.