Skip to content

A Rust and Erlang, Elixir integration toolkit: provides Erlang External Term format and Erlang Distribution Protocol implementations plus a set of higher-level abstractions

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

michaelklishin/edp-rs

Erlang Distribution Protocol Client Toolkit for Rust

This is a set of Rust libraries that implement the Erlang External Term Format and the Erlang Distribution Protocol, and provides a higher-level API for Rust/Erlang (or Rust/Elixir) interoperability based on the ETF.

Inspiration

This project was heavily inspired by a set of Go libraries.

Key Differences from Similar Libraries

  • Extensive test coverage, including unit, integration, and property-based tests
  • crates/erltf implements supports for fragmented messages (a.k.a. DFLAG_FRAGMENTS), a feature almost always skipped by other implementations due to its complexity and imperfect documentation
  • Serde support in erltf via a feature plus two Serde-specific crates (covered below)
  • crates/edp_client and crates/edp_node provide higher-level abstractions
  • (Some) Support for Elixir interop

Project Maturity

This set of libraries is very young. Breaking API changes are fairly likely.

Target Erlang/OTP Versions

This set of libraries target Erlang/OTP 26 and 27. It should be compatible with Erlang 28.

Subprojects

  • crates/edp_client: an Erlang Distribution Protocol client using Tokio
  • crates/erltf: an Erlang Term Format implementation
  • crates/erltf_serde: Serde glue for erltf
  • crates/erltf_serde_derive: derive-oriented Serde glue for erltf
  • crates/edp_elixir: Elixir data type support
  • crates/edp_examples: examples that use Erlang
  • crates/edp_examples_elixir: examples that use Elixir

Examples (Erlang)

  • ets-browser implements an ETS table browser
  • khepri-browser is a Khepri tree and projection browser
  • A number of integration examples can be found under crates/edp_examples and crates/edp_examples_elixir

Throughput and Efficiency

These libraries were developed with efficiency in mind, both in terms of memory allocations and binary parser performance.

The Erlang Term Format encoder and decoder can achive throughput ranging from hundreds of MiBs to tens of GiBs per second, see CONTRIBUTING.md to learn how to run the benchmarks.

Actual throughput will vary from workload to workload.

Elixir Interoperability

Elixir may be a BEAM-based language just like Erlang but it uses a lot of conventions that are not true for the rest of the BEAM ecosystem. This library suite provides some support for Elixir interop, including:

  • Elixir struct mapping to Rust structs with derive(ElixirStruct)
  • The elixir-interop feature that maps Option::None to nil instead of undefined
  • The edp_elixir crate provides Rust representations of common Elixir types (Range, MapSet, Date/Time, exceptions) and GenServer message helpers

Optional Features

This family of crates provides the following optional Cargo features:

Crate Feature Description
erltf serde Implements serde::Serialize and serde::Deserialize for OwnedTerm
erltf elixir-interop Adjusts encoding, decoding behavior to match Elixir conventions (e.g., Option::None becomes the nil atom instead of undefined)
erltf_serde elixir-interop Same as elixir-interop in erltf but in the Serde extensions

Contributing

Contributions to this project are very welcome. Please refer to the CONTRIBUTING.md to learn more.

License

This software is dual-licensed under the MIT License and the Apache License, Version 2.0.

Copyright

(c) 2025-2026 Michael S. Klishin and Contributors.

About

A Rust and Erlang, Elixir integration toolkit: provides Erlang External Term format and Erlang Distribution Protocol implementations plus a set of higher-level abstractions

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Contributing

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •  

Languages