#erlang #term #external #atom #decode #documentation #reference

eetf

Library for encoding/decoding Erlang External Term Format

16 releases (9 breaking)

0.10.0 Mar 16, 2025
0.9.0 Sep 23, 2023
0.8.0 Apr 3, 2022
0.7.0 Mar 23, 2022
0.3.3 Jun 3, 2016

#314 in Encoding

Download history 349/week @ 2024-11-30 587/week @ 2024-12-07 428/week @ 2024-12-14 72/week @ 2024-12-21 129/week @ 2024-12-28 175/week @ 2025-01-04 242/week @ 2025-01-11 515/week @ 2025-01-18 632/week @ 2025-01-25 628/week @ 2025-02-01 564/week @ 2025-02-08 353/week @ 2025-02-15 424/week @ 2025-02-22 569/week @ 2025-03-01 762/week @ 2025-03-08 1232/week @ 2025-03-15

3,063 downloads per month
Used in 7 crates (4 directly)

MIT license

85KB
2.5K SLoC

eetf

eetf Documentation Actions 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
~52K SLoC