BlobPack

class dsviper.BlobPack(descriptor)

Bases: object

Several memory regions packed into one blob, described by a BlobPackDescriptor.

Write with a BlobPackBuilder, whose build() answers the blob; from_blob() reads that blob back. query() or check() then answers a BlobPackRegion, which says where its bytes sit - see its blob().

BlobPack(descriptor) builds a pack whose regions are all zeros: the pack a BlobPackBuilder over descriptor answers before anything is written.

blob() → ValueBlob

Return the blob used to encode the blob pack.

check(name: str) → BlobPackRegion

Return the BlobPackRegion registered under name, or raise if the pack has no such region.

static from_blob(blob: ValueBlob) → BlobPack

Return a BlobPack from a blob or raise.

query(name: str) → BlobPackRegion | None

Return the BlobPackRegion registered under name, or None if the pack has no such region.

regions() → list[BlobPackRegion]

Return the BlobPackRegion list, in the order the descriptor registered them.