Crate eetf

Source
Expand description

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

Modules§

convert
pattern

Structs§

Atom
Atom.
BigInteger
Multiple precision integer.
Binary
Binary.
BitBinary
Bit string.
ByteList
Erlang has a transport optimization for lists only containing u8 elements.
Since Strings in erlang are just lists with u8’s they call this “STRING_EXT”.
ExternalFun
External Function.
FixInteger
Fixed width integer.
Float
Floating point number
ImproperList
Improper list.
List
List.
Map
Map.
Pid
Process Identifier.
Port
Port.
Reference
Reference.
Tuple
Tuple.

Enums§

DecodeError
Errors which can occur when decoding a term
EncodeError
Errors which can occur when encoding a term
InternalFun
Internal Function.
Term
Term.

Type Aliases§

DecodeResult
EncodeResult