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

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

#1687 in Encoding

Download history 224/week @ 2024-08-31 208/week @ 2024-09-07 136/week @ 2024-09-14 252/week @ 2024-09-21 645/week @ 2024-09-28 482/week @ 2024-10-05 293/week @ 2024-10-12 506/week @ 2024-10-19 393/week @ 2024-10-26 372/week @ 2024-11-02 320/week @ 2024-11-09 459/week @ 2024-11-16 467/week @ 2024-11-23 349/week @ 2024-11-30 587/week @ 2024-12-07 425/week @ 2024-12-14

1,876 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

~3.5MB
~53K SLoC