BlobPackRegion

class dsviper.BlobPackRegion

Bases: object

One region of a BlobPack - its name, the layout of its elements, how many it holds, and where it sits in the pack’s blob.

It describes a region; it does not write one. The bytes are filled before the pack is a value, on a BlobPackBuilder.

Note: Not directly instantiable.

blob() → ValueBlob

Return the whole blob of the BlobPack this region belongs to.

The region is the slice blob().encoded()[offset():offset() + byte_count()]; a BlobArray or a BlobView built on a ValueBlob of that slice reads it through blob_layout().

blob_layout() → BlobLayout

Return the BlobLayout of one element of the region.

byte_count() → int

Return the size of the region in bytes.

count() → int

Return the number of elements the region holds.

data_count() → int

Return the number of data the region holds - count() elements of as many components as the layout packs.

name() → str

Return the name the region was registered under, at most 31 bytes.

offset() → int

Return where the region starts in the pack blob, in bytes.