You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28-16Lines changed: 28 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -16,22 +16,34 @@ they unwind into C.
16
16
The library provides functionality for both Erlang and Elixir, however Elixir
17
17
is favored as of now.
18
18
19
-
#### Features:
19
+
#### Features
20
20
21
-
- Safety - The code you write in a Rust NIF should never be able to crash the BEAM.
22
-
- Interop - Decoding and encoding rust values into Erlang terms is as easy as a function call.
23
-
- Type composition - Making a Rust struct encodable and decodable to Erlang or Elixir can be done with a single attribute.
24
-
- Resource objects - Enables you to safely pass a reference to a Rust struct into Erlang code. The struct will be automatically dropped when it's no longer referenced.
21
+
Safety
22
+
: The code you write in a Rust NIF should never be able to crash the BEAM.
25
23
26
-
#### Getting started
24
+
Interop
25
+
: Decoding and encoding rust values into Erlang terms is as easy as a function
26
+
: call.
27
+
28
+
Type composition
29
+
: Making a Rust struct encodable and decodable to Erlang or Elixir can be done
30
+
: with a single attribute.
27
31
28
-
The easiest way of getting started is the [rustler elixir library](https://hex.pm/packages/rustler).
32
+
Resource objects
33
+
: Enables you to safely pass a reference to a Rust struct into Erlang code. The
34
+
: struct will be automatically dropped when it's no longer referenced.
35
+
36
+
#### Getting started
29
37
30
-
- Add the [rustler elixir library](https://hex.pm/packages/rustler) as a dependency of your project.
31
-
- Run `mix rustler.new` to generate a new NIF in your project. Follow the instructions.
32
-
- If you're already using [`serde`](https://serde.rs), consider using [`serde_rustler`](https://github.com/sunny-g/serde_rustler/tree/master/serde_rustler) to easily encode and decode your data types into and from Elixir terms.
38
+
The easiest way of getting started is the [rustler Elixir library](https://hex.pm/packages/rustler).
33
39
34
-
NOTE: If you have previously used Rustler, you need to run `mix archive.uninstall rustler_installer.ez` to remove it before generating the NIF.
40
+
- Add the [rustler Elixir library](https://hex.pm/packages/rustler) as a
41
+
dependency of your project.
42
+
- Run `mix rustler.new` to generate a new NIF in your project. Follow the
43
+
instructions.
44
+
- If you are already using [`serde`](https://serde.rs) and/or have been using
45
+
`serde_rustler` before, please enable the `serde` feature in your NIF crate's
46
+
`Cargo.toml` on the `rustler` dependency.
35
47
36
48
#### What it looks like
37
49
@@ -58,9 +70,9 @@ Rustler aims to support the newest three major OTP versions as well as newest th
58
70
#### Supported NIF version
59
71
60
72
The minimal supported NIF version for a library should be defined via Cargo
61
-
features. The default is currently `2.14` (Erlang/OTP 21). To use features from
62
-
NIF version `2.16` (Erlang/OTP 24), the respective feature flag has to be
63
-
enabled on the dependency:
73
+
features. The default is currently `2.15` (Erlang/OTP 21). To use features from
74
+
NIF version `2.16` (Erlang/OTP 24) or `2.17` (Erlang/OTP 26), the respective
75
+
feature flag has to be enabled on the dependency:
64
76
65
77
```toml
66
78
[dependencies]
@@ -84,5 +96,5 @@ at your option.
84
96
##### Contribution
85
97
86
98
Unless you explicitly state otherwise, any contribution intentionally submitted
87
-
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any
88
-
additional terms or conditions.
99
+
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
100
+
dual licensed as above, without any additional terms or conditions.
0 commit comments