2 unstable releases
0.2.0 | May 23, 2019 |
---|---|
0.1.0 | Oct 12, 2018 |
#26 in #elixir
Used in erlang_port
48KB
1.5K
SLoC
serde_eetf
Erlang external term format support for serde. This allows a rust app to easily talk to erlang, elixir or any other BEAM language with little boilerplate.
lib.rs
:
Erlang external term format support for serde. This allows a rust app to easily talk to erlang, elixir or any other BEAM language with little boilerplate.
use serde_eetf::{to_bytes, from_bytes};
#[derive(Deserialize, Serialize, PartialEq, Debug)]
struct Test {
x: i8
}
let input = Test{ x: 8 };
// Here we convert our Test struct into some bytes that could be sent to
// Erlang.
let bytes = to_bytes(&input).unwrap();
// When we receive a response from Erlang we can convert it back to our Test
// struct.
let result: Test = from_bytes(&bytes).unwrap();
Dependencies
~2.5MB
~43K SLoC