Skip to main content

datapod

Rust/C/Python datapod wire contract for robotics data types and POD-oriented containers.

The crate exposes:

  • Rust DataPod implementations and borrowed Archive/View/Owned APIs.
  • A C ABI with owned handles, generic wire helpers, borrowed DatapodArchiveFrame, and typed archive views.
  • Python bindings with generic wire helpers and declarative schema decorators, including fixed-width annotation markers such as datapod.u16, plus ArchiveFrame/memoryview payload access.

Zero-copy model

Use Archive/View for the fast path:

#[datapod::datapod(name = "robolibs.camera_frame.v1")]
pub struct CameraFrame {
    pub width: u32,
    pub height: u32,
    pub encoding: u32,
    #[dp(bytes)]
    pub data: Vec<u8>,
}

let camera = CameraFrame {
    width: 640,
    height: 480,
    encoding: 11,
    data: frame_bytes,
};

camera.archive(|archive| {
    let _view = CameraFrame::view_archive(archive)?;
    publisher.publish_archive(archive)
})?;

let msg = camera.to_wire_message(); // owned/copying convenience path

For custom Rust types, #[datapod(name = "...")] sets the same canonical schema name model used by C/Python runtime schemas. The macro emits CANONICAL_NAME, TYPE_HASH, register_schema, to_wire_message, archive, segmented_archive, view_archive, and from_archive helpers for the type. The older with_wire_frame, view_from_wire_frame, and from_wire_frame names remain as compatibility aliases.

ArchiveFrame/WireFrame borrows header and payload separately and does not allocate a joined payload buffer. OwnedWireMessage/WireMessage { bytes: Vec<u8> } remains the owned convenience path for files, tests, and transports that require contiguous bytes; it is not the performance path.

C uses DatapodArchiveFrame, generic datapod_archive_split(...) / datapod_archive_to_message(...), and typed archive helpers for opaque owned handles such as datapod_matrix_archive(...), datapod_matrix_view_from_archive(...), and datapod_matrix_from_archive(...). Python uses obj.archive(), datapod.view_archive(...), and typed view_archive(...) helpers that expose payloads as memoryview.

Wire format policy

See docs/WIRE_FORMAT.md for the current datapod-wire-v1/le format, validation rules, and C/Python borrowed-view lifetime rules.

Fallible owned container APIs

Rust byte-backed containers keep the historical ergonomic methods (push, pop, get, insert, etc.) as panic-on-invalid convenience wrappers, but the production path is the matching try_* API. Examples include try_push, try_pop, try_get, try_set, try_insert, try_push_back, try_push_front, and try_from_bytes. These fallible methods validate the current owned value before mutation, use checked wire-size arithmetic, and preserve no-mutate-on-error behavior for malformed owned buffers.

Build and test

Use the Makefile lanes:

nix develop --command make test
nix develop --command make bench
nix develop --command make bind
nix develop --command make test-bindings

make bench runs Rust, C, and Python owned-vs-borrowed payload benchmarks and prints copied bytes per operation.

Metadata

Release files for robolib-datapod 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for robolib-datapod 0.4.1
File Size Uploaded Provenance Actions
robolib_datapod-0.4.1.tar.gz 306.7 kB Without provenance Details for robolib_datapod-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for robolib-datapod 0.4.1
File Interpreter ABI Platform Actions
robolib_datapod-0.4.1-cp39-abi3-manylinux_2_34_x86_64.whl CPython 3.9 abi3 Linux glibc 2.34+ x86-64 Details for robolib_datapod-0.4.1-cp39-abi3-manylinux_2_34_x86_64.whl

Total release size: 1.4 MB

Release files / robolib_datapod-0.4.1.tar.gz

Download URL robolib_datapod-0.4.1.tar.gz
Size 306.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9d2b0a79a910d1f9c5b29613c13adf7d101dfa7ee6393a56f25c290eafe742e2
BLAKE2b-256 checksum
How to use checksums
13d049504ecb1849e6c6f49e367adccf2d7aa3ae803355001feac927e6e26807
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.11.5

Release files / robolib_datapod-0.4.1-cp39-abi3-manylinux_2_34_x86_64.whl

Download URL robolib_datapod-0.4.1-cp39-abi3-manylinux_2_34_x86_64.whl
Size 1.1 MB
Tags CPython 3.9 Linux glibc 2.34+ x86-64 abi3
SHA-256 checksum
How to use checksums
dd4e6389ee5a6cd21349bbffba7dfcd8db735002f436b73012ab69aa85067b81
BLAKE2b-256 checksum
How to use checksums
d3b698e17ca0340952aff0e356b31e45aee7fbf300c08c1dbba2d6abdd43614e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.11.5

Security for robolib-datapod 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page