BlobArrayBuilder

class dsviper.BlobArrayBuilder(blob_layout, count)

Bases: object

Fills the bytes of one typed array, then seals them into a ValueBlob.

Write through the buffer protocol, by index, or with copy(); build() hands the bytes over once. A blob’s bytes never change afterwards.

blob_layout() BlobLayout

Return the BlobLayout of one element: its data type and how many components it packs.

build() ValueBlob

Return the ValueBlob of the bytes written so far, and empty the builder.

The bytes are moved, not copied, so a value never shares them with a writer: every later write is refused. Fails while a buffer of this builder is still exported — release the memoryview, or delete the NumPy array holding it, first.

byte_count() int

Return how many bytes the array occupies.

copy(buffer: Buffer) None

Write buffer over the whole array; its size must match byte_count().

count() int

Return how many elements the array holds, fixed at construction.

is_built() bool

Return whether build() has handed the bytes over to a blob.