pub enum TypedTerm<'id> {
Atom(Atom),
Bitstring(Bitstring<'id>),
Float(Float<'id>),
Fun(Fun<'id>),
Integer(Integer<'id>),
List(List<'id>),
Map(Map<'id>),
Pid(Pid<'id>),
Port(Port<'id>),
Reference(Reference<'id>),
Tuple(Tuple<'id>),
}Expand description
Typed enum produced by AnyTerm::resolve. One enif_term_type call has
been made; the data is still on the BEAM heap.
Mirrors BEAM’s ErlNifTermType: byte-aligned binaries and sub-byte
bitstrings share the Bitstring variant (BEAM treats
every binary as a bitstring). Refine with Bitstring::to_binary.
Variants§
Atom(Atom)
An atom.
Bitstring(Bitstring<'id>)
A binary or sub-byte bitstring (enif_term_type reports both as
Bitstring). Refine to a byte-aligned Binary with
Bitstring::to_binary.
Float(Float<'id>)
A float.
Fun(Fun<'id>)
A fun (closure or &module:function/arity).
Integer(Integer<'id>)
An integer (fixnum or bignum).
List(List<'id>)
A list (proper or improper; the empty list [] is also a list).
Map(Map<'id>)
A map.
Pid(Pid<'id>)
A pid (local or external).
Port(Port<'id>)
A port (local or external).
Reference(Reference<'id>)
A reference.
Tuple(Tuple<'id>)
A tuple.
Trait Implementations§
impl<'id> Copy for TypedTerm<'id>
Source§impl<'id> Decoder<'id> for TypedTerm<'id>
Resolves the term to its TypedTerm variant (one enif_term_type call).
A type code this otter build does not recognize — a term type from a newer
OTP — is UnknownTermType.
impl<'id> Decoder<'id> for TypedTerm<'id>
Resolves the term to its TypedTerm variant (one enif_term_type call).
A type code this otter build does not recognize — a term type from a newer
OTP — is UnknownTermType.
Source§impl<'id> Encoder<'id> for TypedTerm<'id>
Encodes the already-resolved term by rewrapping its word. Never fails.
impl<'id> Encoder<'id> for TypedTerm<'id>
Encodes the already-resolved term by rewrapping its word. Never fails.
impl Eq for TypedTerm<'_>
Source§impl Ord for TypedTerm<'_>
Erlang term order (enif_compare) — the standard cross-type ordering
number < atom < reference < fun < port < pid < tuple < map < nil < list < bitstring, not a Rust-derived ordering.
impl Ord for TypedTerm<'_>
Erlang term order (enif_compare) — the standard cross-type ordering
number < atom < reference < fun < port < pid < tuple < map < nil < list < bitstring, not a Rust-derived ordering.
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for TypedTerm<'_>
Term identity (enif_is_identical) — the BEAM’s =:=, not Rust structural
equality. Ignores the variant tag and compares the underlying terms.
impl PartialEq for TypedTerm<'_>
Term identity (enif_is_identical) — the BEAM’s =:=, not Rust structural
equality. Ignores the variant tag and compares the underlying terms.
Source§impl PartialOrd for TypedTerm<'_>
impl PartialOrd for TypedTerm<'_>
Source§impl<'id> Term<'id> for TypedTerm<'id>
impl<'id> Term<'id> for TypedTerm<'id>
Source§fn copy_to<'dst>(self, env: impl Env<'dst>) -> AnyTerm<'dst>where
Self: Sized,
fn copy_to<'dst>(self, env: impl Env<'dst>) -> AnyTerm<'dst>where
Self: Sized,
enif_make_copy), producing a
term branded to the destination. The general cross-env copy — distinct
from same-brand Encoder (which wraps for free)
and from OwnedEnvArena copy_out (the arena exit).