ReadonlyaccReadonlycapReadonlyelemReadonlynameReadonlyoutReadonlyreceiverReadonlyreceiverSee StringSeq.begin — the early bound check, for subtype blob.
One payload piece of element id (Visitor.blob).
The array has ended: cut out to this decode's length — ElementSeq.end
— and disarm, so an element after it costs nothing for a window that is gone.
Arm reuse mode — see ElementSeq.reuse, and here it reaches the
element's own storage too: where the previous decode left a Uint8Array at
this index and the payload now arriving is exactly its length, the payload is
written into that buffer (PayloadAcc.takeInto) instead of into a new
one. A length that does not match allocates, as always — the buffer's length
is the element's length, so there is nothing to trim it with.
The buffer the previous decode handed out is therefore overwritten: a caller that kept a reference to an element of an earlier message sees it change. That is what decoding into a reused destination means, one level down.
And it is overwritten as the pieces arrive, which is what buys the chunked
path. So a decode abandoned part-way through an element's payload — a chunk
boundary that never gets its continuation, an INVALID later in the message, a
one-shot buffer that ends inside the payload — leaves that one element holding
a mix of the new payload's leading bytes and the old one's tail: not the value
that was there, and not a value that was ever on the wire. Every other element
of the retained message is untouched, and the ones this decode completed are
complete. A caller that falls back to the last good message cannot rely on the
element the abandoned decode had already started — whether it was abandoned by
a refusal or by a truncation tryDecode reported as a returned Incomplete;
nothing short of buffering the payload elsewhere would change that, and
buffering it is the allocation this mode exists to remove.
this collector, so it can be armed where it is built.
Collects the elements of a
blobwrapper-sequence array intoout. Thestringtwin above, with two differences: the payload is stored as bytes rather than decoded, and gaps are filled with an empty Uint8Array.Each element is storage of its own — what PayloadAcc returns is a buffer it allocated and handed over, or in reuse mode one the destination already held, never a view into the fed chunk (§6.7) — so a stored element cannot rot when the caller reuses its input.
Param: out
The destination, placed at
out[id].Param: acc
The decoder's shared PayloadAcc.
Param: cap
The schema
countas an index capacity, or UNBOUNDED (-1) for unbounded.Param: elemMax
The element
maxlenin bytes, or UNBOUNDED (-1) for an element the schema left open, wherereceiverElemMaxgoverns instead.Param: name
The schema field name, used only in the rejection message.
Param: receiverCap
The receiver-side index cap for a schema-unbounded array (§6.2.1) — see StringSeq. Required, with no default.
Param: receiverElemMax
The receiver-side
max_dyn_blob_lenfor a schema-unbounded element (§6.2.1) — see StringSeq. Required, with no default.