eetf

Encode and decode Erlang External Term Format payloads for Rust-to-BEAM interoperability.

71|13|Updated Jun 4, 2015
One-click install
npx skills add https://github.com/sile/eetf --skill eetf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: eetf
Source: https://github.com/sile/eetf/tree/main/skills/eetf
Command: npx skills add https://github.com/sile/eetf --skill eetf

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The eetf skill solves the problem of converting Erlang External Term Format (ETF) binaries into usable Rust values and encoding Rust data back into ETF bytes for BEAM interop.

Core Features & Use Cases

  • Decode ETF terms from bytes: Parse ETF payloads that begin with the version byte 131 (0x83) into strongly-typed Rust representations.
  • Encode Rust terms to ETF bytes: Produce payloads compatible with Erlang/Elixir producers like term_to_binary/1 and consumers like binary_to_term/1.
  • Handle BEAM-specific types and patterns: Support atoms, binaries, lists (including ByteList/STRING_EXT), tuples, maps, pids/ports/references, and provide pattern matching helpers for {ok, Value}/ {error, Reason}-style replies.

Quick Start

Use eetf to decode the attached ETF bytes into a Rust Term value, then encode that Term back into ETF bytes.

Frequently Asked Questions about eetf

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I decode Erlang External Term Format payloads in Rust?

You can decode Erlang External Term Format payloads in Rust by parsing bytes that start with version byte 131 into strongly-typed Rust Term values. This handles BEAM types like atoms, binaries, lists, and maps.

Can I encode Rust values into ETF binaries compatible with Erlang term_to_binary/1?

Yes, you can encode Rust values into ETF binaries to produce payloads compatible with Erlang's term_to_binary/1 and Elixir producers. This ensures correct wire-format constraints for consumers like binary_to_term/1.

What BEAM-specific types are supported when parsing ETF binary data in Rust?

Parsing ETF binary data in Rust supports BEAM-specific types including atoms, binaries, lists with ByteList/STRING_EXT, tuples, maps, pids, ports, and references. Pattern matching helpers for {ok, Value} and {error, Reason} replies are also included.

Does Rust ETF interop handle distribution protocol payloads and port messages?

Yes, Rust ETF interop handles distribution protocol payloads and port messages. It provides precise decoding and encoding error types to robustly process wire messages for Erlang and Elixir interoperability scenarios.

Why am I getting decoding errors when parsing ETF bytes that start with version byte 131?

Decoding errors when parsing ETF bytes starting with version byte 131 occur due to invalid wire-format constraints or unsupported ETF tags. The library provides precise decoding error types to help identify the exact malformed term structure.