secret
struct secretAvailable without an import.
A value holding UTF-32 content whose payload bytes are redacted from snapshots and recordings
while structure and length remain visible. Live memory still contains the real content. Copies
share storage until mutation replaces one copy's buffer. Explicit reads and Reveal produce
ordinary values, which are not automatically secret. Text formatting is redacted; equality,
hashing, and ordering are unavailable.
Members
constructorconstructor
public constructor ()Creates empty secret content.
Countgetter
public get Count() : int32The number of stored UTF-32 entries, not the encoded UTF-8 byte length.
Appendmethod
public fn Append(uint32 scalar) : voidAppends one scalar value using a new secret buffer. Does not validate the scalar; invalid values become U+FFFD when revealed as text.
AppendRunmethod
public fn AppendRun(scoped ReadOnlySpan<uint32> run) : voidCopies a run of UTF-32 values into a new secret buffer with one allocation. The source view is not retained; an empty run does nothing.
AppendTextmethod
public fn AppendText(TextEvent text) : voidCopies the text payload of the current text event into secret storage. The event's borrowed payload is not retained.
Insertmethod
public fn Insert(int32 index, uint32 scalar) : voidInserts one value before index, which must be in [0, Count], or panics. Mutation
replaces this value's backing buffer.
RemoveAtmethod
public fn RemoveAt(int32 index) : voidRemoves one in-range entry; an invalid index panics.
RemoveRangemethod
public fn RemoveRange(int32 start, int32 length) : voidRemoves a nonnegative range wholly within the content, or panics. An empty range at the end is valid.
Clearmethod
public fn Clear() : voidReplaces this value's content with an empty buffer. Other copies retaining earlier content are unchanged.
Atmethod
public fn At(int32 index) : uint32Explicitly reads one UTF-32 entry. Out-of-range indices panic. Recorded redacted payload reads can differ from the live execution.
Revealmethod
public fn Reveal() : stringCreates an ordinary UTF-8 string containing the secret text. Invalid scalar values become U+FFFD. The returned string is not redacted merely because its source was secret.
ToStringmethod
public fn ToString() : stringProvided by the compiler.
ToStringBuffermethod
public fn ToStringBuffer(StringBuilder builder) : int32Provided by the compiler.