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 robolibs-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 robolibs-datapod 0.4.1
File Size Uploaded Provenance Actions
robolibs_datapod-0.4.1.tar.gz 306.7 kB Without provenance Details for robolibs_datapod-0.4.1.tar.gz

Built distribution (wheel)

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

Total release size: 1.4 MB

Release files / robolibs_datapod-0.4.1.tar.gz

Download URL robolibs_datapod-0.4.1.tar.gz
Size 306.7 kB
Tags Source
SHA-256 checksum
How to use checksums
328638c3a6431a260d5524ae407613c5e76634f54945c32554d041fd023558a2
BLAKE2b-256 checksum
How to use checksums
097de0e74754022df0e6ba5386171371fe4199fa98c0e1caad81791e91c42722
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.11.5

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

Download URL robolibs_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
e95316430aa779ec2e07894a8867391cda4e826376e210d2eb48515e96fd9938
BLAKE2b-256 checksum
How to use checksums
d39ab9f7526fa7c650d4f95b766e7f273ac995b1ae67433baf9e2dff06337c81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.11.5

Security for robolibs-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