WriteOnlySpan
scoped struct WriteOnlySpan<T>import WriteOnlySpan from Wax;A scoped, borrowed window that allows writes but exposes no element reads. It can cover
unassigned lateinit slots. A slice shares storage; its writes initialize only that window.
Prove a late array fully assigned with AllAssigned or AsArray before treating it as dense.
Members
lengthfield
public native int32 lengthThe number of elements in the borrowed window.
sizegetter
public get size() : int32The number of elements, equal to length.
thisindexer-setter
public set this(int32 index, T value) : voidWrites an in-range zero-based element. Out-of-range indices panic. No corresponding getter exists.
Slicemethod
public fn Slice(int32 sliceStart, int32 len) : WriteOnlySpan<T>Borrows a subwindow. Negative arguments or an endpoint outside [0, length] panic; an empty
slice at the end is valid.
Fillmethod
public fn Fill(T value) : voidAssigns every element of the window. Empty views do nothing; references are copied without cloning their objects.
CopyFrommethod
public fn CopyFrom(ReadOnlySpan<T> source) : void where T is blittableCopies the shorter of the source and destination lengths in increasing index order. The remaining destination is unchanged. Overlapping ranges are not treated as a snapshot: earlier writes can affect later reads.
ToStringmethod
public fn ToString() : stringProvided by the compiler.
ToStringBuffermethod
public fn ToStringBuffer(StringBuilder builder) : int32Provided by the compiler.