← Standard library

secret

struct secret

Available 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.

Secret.wax:36

Members

constructorconstructor

public constructor ()

Creates empty secret content.

Secret.wax:48

Countgetter

public get Count() : int32

The number of stored UTF-32 entries, not the encoded UTF-8 byte length.

Secret.wax:55

Appendmethod

public fn Append(uint32 scalar) : void

Appends one scalar value using a new secret buffer. Does not validate the scalar; invalid values become U+FFFD when revealed as text.

Secret.wax:63

AppendRunmethod

public fn AppendRun(scoped ReadOnlySpan<uint32> run) : void

Copies 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.

Secret.wax:76

AppendTextmethod

public fn AppendText(TextEvent text) : void

Copies the text payload of the current text event into secret storage. The event's borrowed payload is not retained.

Secret.wax:99

Insertmethod

public fn Insert(int32 index, uint32 scalar) : void

Inserts one value before index, which must be in [0, Count], or panics. Mutation replaces this value's backing buffer.

Secret.wax:119

RemoveAtmethod

public fn RemoveAt(int32 index) : void

Removes one in-range entry; an invalid index panics.

Secret.wax:138

RemoveRangemethod

public fn RemoveRange(int32 start, int32 length) : void

Removes a nonnegative range wholly within the content, or panics. An empty range at the end is valid.

Secret.wax:146

Clearmethod

public fn Clear() : void

Replaces this value's content with an empty buffer. Other copies retaining earlier content are unchanged.

Secret.wax:168

Atmethod

public fn At(int32 index) : uint32

Explicitly reads one UTF-32 entry. Out-of-range indices panic. Recorded redacted payload reads can differ from the live execution.

Secret.wax:179

Revealmethod

public fn Reveal() : string

Creates 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.

Secret.wax:190

ToStringmethod

public fn ToString() : string

Provided by the compiler.

ToStringBuffermethod

public fn ToStringBuffer(StringBuilder builder) : int32

Provided by the compiler.