nachricht 0.4.0

Implementation of the nachricht wire format
Documentation
  • Coverage
  • 39.13%
    18 out of 46 items documented1 out of 1 items with examples
  • Size
  • Source code size: 40.59 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 892.18 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • yasammez/nachricht
    77 3 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • yasammez

Rust bindings for the nachricht data interchange format

This is a pure Rust implementation of the binary nachricht data interchange format.

Minimum supported Rust version

Since this crates makes use of the fallible collection API to pre-allocate Collections when deserializing values, the minimum required Rust version is 1.57.0.

Usage

Add this to your Cargo.toml:

[dependencies]
nachricht = "0.4.0"

Then you can construct, encode and decode nachricht messages:

use std::borrow::Cow;
use std::collections::BTreeMap;
use nachricht::*;

fn main() -> Result<(), Box<dyn Error>> {
    let mut buf = Vec::new();
    let nachricht = Value::Record(BTreeMap::from([(Cow::Borrowed("key"), Value::Str(Cow::Borrowed("value")))]));
    Encoder::encode(&nachricht, &mut buf)?;
    let decoded = Decoder::decode(&buf)?.0;
    assert_eq!(nachricht, decoded);
    Ok(())
}