Expand description
Modules§
- decode
- dtype
- encode
- error
- file
- framing
- hash
- iter
- Iterator types for lazy traversal of messages and objects.
- metadata
- pipeline
- Shared encoding/filter/compression pipeline helpers for importers.
- streaming
- types
- validate
- Validation of tensogram messages and files.
- wire
Structs§
- Data
Object Descriptor - Per-object descriptor — merges tensor metadata and encoding instructions.
- Data
Pipeline - Encoding/filter/compression configuration for data objects.
- Decode
Options - Options for decoding.
- Encode
Options - Options for encoding.
- File
Issue - A file-level issue (not tied to a specific message).
- File
Message Iter - Lazy iterator over messages stored in a file.
- File
Validation Report - Result of validating a
.tgmfile. - Global
Metadata - Global message metadata (carried in header/footer metadata frames).
- Hash
Descriptor - Hash descriptor for payload integrity verification.
- Hash
Frame - Hash frame payload — per-object integrity hashes.
- Index
Frame - Index frame payload — maps object ordinals to byte offsets.
- Message
Flags - Flags in the message preamble indicating which optional frames are present.
- Message
Iter - Zero-copy iterator over messages in a byte buffer.
- Object
Iter - Iterator over the decoded objects (tensors) in a single message.
- Streaming
Encoder - A streaming encoder that writes Tensogram frames progressively to a sink.
- Tensogram
File - A handle for reading/writing Tensogram message files.
- Validate
Options - Options passed to
validate_message. - Validation
Issue - A single validation finding.
- Validation
Report - Result of validating a single message.
Enums§
- Byte
Order - Compression
Backend - Selects which backend to use when both FFI and pure-Rust implementations are compiled in for the same codec (szip or zstd).
- Dtype
- Frame
Type - Frame type identifiers (uint16).
- Hash
Algorithm - Issue
Code - Stable machine-readable issue codes.
- Issue
Severity - Severity of a validation finding.
- Tensogram
Error - Validation
Level - Validation levels, from lightest to most thorough.
Constants§
- DEFAULT_
PARALLEL_ THRESHOLD_ BYTES - Default threshold below which the library runs sequentially even when
threads > 0. Chosen to be well above the per-call rayon pool construction cost (~10 µs) but small enough not to starve encode paths that want parallelism. - ENV_
THREADS - Env var consulted when the caller-provided
threadsis0. Must parse as au32; zero, missing, empty, or otherwise unparseable values all resolve to0(sequential execution). - RESERVED_
KEY - Key reserved for library-managed metadata (ndim/shape/strides/dtype/provenance).
Functions§
- apply_
pipeline - Apply a
DataPipelineto aDataObjectDescriptorby setting itsencoding/filter/compressionfields and populatingparams. - compute_
common - Extract keys common to ALL base entries.
- compute_
hash - Compute a hash of the given data, returning the hex-encoded digest.
- decode
- Decode all objects from a message buffer. Returns (global_metadata, list of (descriptor, decoded_data)).
- decode_
descriptors - Decode global metadata and per-object descriptors without decoding any payload data.
- decode_
metadata - Decode only global metadata from a message buffer, skipping payloads.
- decode_
object - Decode a single object by index (O(1) access via index frame). Returns (global_metadata, descriptor, decoded_data).
- decode_
range - Decode partial ranges from a data object.
- decode_
range_ from_ payload - encode
- Encode a complete Tensogram message.
- encode_
pre_ encoded - Encode a pre-encoded Tensogram message where callers supply already-encoded bytes.
- messages
- Create a zero-copy iterator over messages in a byte buffer.
- objects
- Create an iterator that decodes each object in a message on demand.
- objects_
metadata - Return an iterator over the
DataObjectDescriptors in a message without decoding any payload data. - scan
- Scan a multi-message buffer for message boundaries. Returns (offset, length) of each message found.
- scan_
file - Scan a file for message boundaries without loading the entire file into memory.
- validate_
buffer - Validate all messages in a byte buffer (may contain multiple messages).
- validate_
file - Validate all messages in a
.tgmfile. - validate_
message - Validate a single message buffer.
- verify_
canonical_ cbor - Verify that CBOR bytes are in RFC 8949 §4.2.1 canonical form.
- verify_
hash - Verify a hash descriptor against data.
Type Aliases§
- Decoded
Object - A decoded object: its descriptor paired with its raw decoded payload bytes.
- Result