#erlang #term #format #external #codec #atom #decode

eetf

Library for encoding/decoding Erlang External Term Format

15 releases (8 breaking)

0.9.0 Sep 23, 2023
0.8.0 Apr 3, 2022
0.7.0 Mar 23, 2022
0.6.0 Aug 7, 2021
0.3.3 Jun 3, 2016

#1518 in Encoding

Download history 197/week @ 2024-03-11 285/week @ 2024-03-18 157/week @ 2024-03-25 289/week @ 2024-04-01 173/week @ 2024-04-08 102/week @ 2024-04-15 210/week @ 2024-04-22 273/week @ 2024-04-29 133/week @ 2024-05-06 227/week @ 2024-05-13 328/week @ 2024-05-20 80/week @ 2024-05-27 261/week @ 2024-06-03 108/week @ 2024-06-10 101/week @ 2024-06-17 173/week @ 2024-06-24

646 downloads per month
Used in 7 crates (4 directly)

MIT license

83KB
2.5K SLoC

eetf

eetf Documentation Actions Status Coverage Status License: MIT

A Rust implementation of Erlang External Term Format.

Documentation

See RustDoc Documentation.

The documentation includes some examples.


lib.rs:

Library for encoding/decoding Erlang External Term Format.

Examples

Decodes an atom:

use std::io::Cursor;
use eetf::{Term, Atom};

let bytes = vec![131, 100, 0, 3, 102, 111, 111];
let term = Term::decode(Cursor::new(&bytes)).unwrap();
assert_eq!(term, Term::from(Atom::from("foo")));

Encodes an atom:

use eetf::{Term, Atom};

let mut buf = Vec::new();
let term = Term::from(Atom::from("foo"));
term.encode(&mut buf).unwrap();
assert_eq!(vec![131, 100, 0, 3, 102, 111, 111], buf);

Reference

Dependencies

~4MB
~68K SLoC