nachricht

Crates.ionachricht
lib.rsnachricht
version0.4.0
sourcesrc
created_at2020-12-22 15:05:33.711854
updated_at2022-03-26 15:55:20.612651
descriptionImplementation of the nachricht wire format
homepage
repositoryhttps://github.com/yasammez/nachricht
max_upload_size
id326031
size40,596
Liv Fischer (yasammez)

documentation

https://docs.rs/nachricht

README

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(())
}
Commit count: 52

cargo fmt