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: rustler/src/serde/de.rs
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,8 @@ use serde::{
12
12
};
13
13
use std::iter;
14
14
15
-
/// Converts a native Elixir term to a native Rust type. See the [conversion table](https://github.com/sunny-g/serde_rustler/tree/master/serde_rustler#conversion-table) for details about deserialization behavior.
15
+
/// Converts a native BEAM term to a native Rust object. See the conversion table
<a name="todo">1</a>: API still being decided / implemented.
76
+
77
+
<a name="atom">2</a>: When serializing unknown input to terms, atoms will not be created and will instead be replaced with Elixir bitstrings. Therefore "records" will be tuples (`{bitstring, ...}`) and "structs" will be maps containing `%{:__struct__ => bitstring}`. The unfortunate consequence of this is that `deserialize_any` will lack the necessary information needed deserialize many terms without type hints, such as `structs`, `enums` and `enum variants`, and `tuples`.
78
+
*/
79
+
1
80
pubmod atoms;
2
81
mod de;
3
82
mod error;
@@ -10,6 +89,13 @@ pub use ser::{to_term, Serializer};
10
89
11
90
usecrate::{Decoder,Encoder,Env,NifResult,Term};
12
91
92
+
/// Wrapper type to en- and decode serde terms
93
+
///
94
+
/// If the wrapped type implements `serde::Serialize`, `SerdeTerm<T>` implements
95
+
/// `Encoder` and will thus be transparently converted *to* a BEAM object.
96
+
///
97
+
/// If the wrapped type implements `serde::Deserialize`, it implements `Decoder`
98
+
/// and can thus be transparently converted *from* a BEAM object.
Copy file name to clipboardExpand all lines: rustler/src/serde/ser.rs
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,8 @@ use crate::{types::tuple, Encoder, Env, OwnedBinary, Term};
6
6
use serde::ser::{self,Serialize};
7
7
8
8
#[inline]
9
-
/// Converts a native Rust type into a native Elixir term. See [conversion table](https://github.com/sunny-g/serde_rustler/tree/master/serde_rustler#conversion-table) for details about serialization behavior.
10
-
///
9
+
/// Converts a native Rust type into a native BEAM term. See conversion table
0 commit comments