zerodds-foundation 1.0.0-rc.5

ZeroDDS foundation primitives: hot-path stack buffer, wire-integrity hashes (CRC-32C / CRC-64-XZ / MD5), structured observability events + sinks, tracing spans + histograms, lock-free RCU cell. Pure-Rust no_std.
Documentation

zerodds-foundation

License: Apache-2.0 docs.rs

Foundation-layer primitives for the ZeroDDS stack. Pure Rust, no_std-capable, forbid(unsafe_code). Safety classification: SAFE.

What's inside

  • Stack bufferPoolBuffer<CAP> with fixed capacity for hot-path allocations without touching the heap; explicit PoolBufferError::Overflow instead of a panic.
  • Wire-integrity hashescrc32c (RFC 4960 App. B), crc64_xz (ECMA-182 / XZ utils), md5 (RFC 1321). Pure Rust with no external crypto-crate dependency. Used in the DDSI-RTPS HEADER_EXTENSION checksum, XTypes EquivalenceHash, KeyHash and group digest.
  • Observability — structured Event/Component/Level plus a Sink trait for arbitrary consumers. NullSink, StderrJsonSink, VecSink as reference implementations.
  • TracingSpan/SpanContext/TraceId/SpanId plus Histogram for coarse-grained tracing; OTLP export in the zerodds-observability-otlp crate.
  • RCURcuCell<T> as a copy-on-write container for low-write/high-read patterns without unsafe (mutex-protected reference cell, Arc<T> snapshots).

Layer position

Layer 0 (Foundation). Has no dependencies on other ZeroDDS crates. Used by layer 1 (primitives: cdr, qos, types) and all higher layers.

Quickstart

use zerodds_foundation::{crc32c, PoolBuffer, PoolBufferError};

// CRC-32C over an RTPS datagram.
let payload = b"\x52\x54\x50\x53\x02\x05\x01\x0F";
let checksum = crc32c(payload);

// Hot-path buffer with fixed capacity.
let mut buf: PoolBuffer<256> = PoolBuffer::new();
buf.extend_from_slice(payload).unwrap();

// Overflow is explicit, no panic.
let mut tiny: PoolBuffer<4> = PoolBuffer::new();
assert_eq!(
    tiny.extend_from_slice(payload),
    Err(PoolBufferError::Overflow)
);

Feature flags

Feature Default Purpose
std Enables RcuCell, StderrJsonSink, VecSink. Implies alloc.
alloc ✅ (via std) Enables observability + tracing + MD5 with arbitrary input length.
safety Reserved for future safety build constraints.

Without features (default-features = false): only PoolBuffer, crc32c, crc64_xz, md5 (the no_std MD5 path is limited to 56 bytes of input).

Stability

All pub items are stable from 1.0.0; breaking changes require a major version bump.

Tests

cargo test -p zerodds-foundation

License

Apache-2.0. See LICENSE.

See also