Skip to main content

zerodds_wire/
lib.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2026 ZeroDDS Contributors
3//! Crate `zerodds-wire`. Safety classification: **SAFE**.
4//!
5//! The runtime a generated encoder calls: `Writer` and `Reader`, the
6//! alignment rules, and the framing forms.
7//!
8//! This crate makes no decision about a type. Which members are written,
9//! in what order, with which header and which length code is the layout
10//! plan's answer and arrives here as arguments. A runtime that decided
11//! any of it would be a second place where the wire format lives.
12//!
13//! ## Spec
14//!
15//! - `docs/specs/zerodds-ast-1.0.md` §7 (the layout plan this serves).
16//! - DDS-XTypes 1.3 §7.4 for the encodings themselves.
17//!
18//! ## Layer position
19//!
20//! Layer 0. Its one dependency is `zerodds-float128`, the value type of
21//! `long double`; it does not depend on the model — a runtime that reached
22//! back into the model would be a runtime that could disagree with it.
23#![no_std]
24#![forbid(unsafe_code)]
25
26extern crate alloc;
27
28#[cfg(test)]
29extern crate std;
30
31pub mod digest;
32pub mod endianness;
33pub mod error;
34pub mod map_entries;
35pub mod reader;
36pub mod try_construct;
37pub mod writer;
38
39pub use digest::md5;
40pub use endianness::Endianness;
41pub use error::WireError;
42pub use map_entries::{AscendingKey, MapEntry, WireMap};
43pub use reader::Reader;
44pub use try_construct::{
45    Narrowed, TryConstruct, fit_map, fit_map_entries, fit_sequence, fit_string, fit_wstring,
46};
47pub use writer::{
48    FixedDigits, FixedParts, ParameterRole, PidFlagPolicy, PlCdr1Framing, PlCdr1Reading,
49    WcharFraming, WcharPosition, WcharWidth, WirePosition, Writer, WstringLengthCounts,
50    WstringLengthPolicy, WstringTerminator, WstringUnitOrder, WstringUnitWidth, parse_fixed,
51};