5 releases

0.1.4 Jul 4, 2023
0.1.3 Jan 12, 2023
0.1.2 Dec 5, 2022
0.1.1 Nov 30, 2022
0.1.0 Apr 28, 2022

#430 in Encoding

Download history 10/week @ 2023-12-15 9/week @ 2023-12-22 115/week @ 2023-12-29 107/week @ 2024-01-05 46/week @ 2024-01-12 46/week @ 2024-01-19 7/week @ 2024-01-26 2/week @ 2024-02-02 10/week @ 2024-02-09 26/week @ 2024-02-16 49/week @ 2024-02-23 41/week @ 2024-03-01 42/week @ 2024-03-08 69/week @ 2024-03-15 107/week @ 2024-03-22 84/week @ 2024-03-29

315 downloads per month
Used in 13 crates (4 directly)

EUPL-1.2

80KB
2K SLoC

CESRox

CESRox is a Rust based implementation of CESR protocol.

Protocol overview

The Composable Event Streaming Representation (CESR) is dual text-binary encoding format that has the unique property of text-binary concatenation composability. This composability property enables the round trip conversion en-masse of concatenated primitives between the text domain and binary domain while maintaining separability of individual primtives. This enables convenient usability in the text domain and compact transmission in the binary domain. CESR primitives are self-framing. CESR supports self-framing group codes that enable stream processing and pipelining in both the text and binary domains. CESR supports composable text-binary encodings for general data types as well as suites of cryptographic material. Popular cryptographic material suites have compact encodings for efficiency while less compact encodings provide sufficient extensibility to support all foreseeable types. CESR streams also support interleaved JSON, CBOR, and MGPK serializations. CESR is a universal encoding that uniquely provides dual text and binary domain representations via composable conversion.

Implementation assumptions, trade-offs and limitations

  • it deserializes CESR streams into payloads with attachments and serializes payloads with attachments into CESR streams;
  • it is agnostic to any data model as it imposes on the consumer to provide payloads already represented in one of the CESR-compliant representations (JSON, MGPK, CBOR) – thus consumer data model stays encapsulated within the consumer codebase (and the consumer decides with which representation to go);
  • it aims to be exposed via FFI layers to the other programming languages. Therefore, it heavily relies on primitives rather than complex object structures – primitives enable almost seamless integrations as opposed to complex object structures. It is also the direct consequence of imposing consumer data model (de)serialization on her side;
  • it requires POSIX-compliant OS, yet it is possible to go with the no-std approach for non-POSIX support (PRs are welcome);
  • due to the nature of parsing CESR streams that are computationally intense rather than i/o intense, it is intentionally provided without any Async-compliant capabilities.

Usage

For CESRox usage examples, see integration tests.

Dependencies

~3.5–4.5MB
~87K SLoC