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§
Structs§
- Atom
- Atom.
- BigInteger
- Multiple precision integer.
- Binary
- Binary.
- BitBinary
- Bit string.
- Byte
List - 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”. - External
Fun - External Function.
- FixInteger
- Fixed width integer.
- Float
- Floating point number
- Improper
List - Improper list.
- List
- List.
- Map
- Map.
- Pid
- Process Identifier.
- Port
- Port.
- Reference
- Reference.
- Tuple
- Tuple.
Enums§
- Decode
Error - Errors which can occur when decoding a term
- Encode
Error - Errors which can occur when encoding a term
- Internal
Fun - Internal Function.
- Term
- Term.