nachricht 0.2.0

Implementation of the nachricht wire format
Documentation

Rust bindings for the nachricht data interchange format

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

Usage

Add this to your Cargo.toml:

[dependencies]
nachricht = "0.1.0"

Then you can construct, encode and decode nachricht messages:

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

fn main() -> Result<(), Box<dyn Error>> {
    let mut buf = Vec::new();
    let nachricht = Field { name: Some(Cow::Borrowed("key")), value: Value::Bool(true) };
    Encoder::encode(&nachricht, &mut buf)?;
    let decoded = Decoder::decode(&buf)?.0;
    assert_eq!(nachricht, decoded);
    Ok(())
}