ErlangValues¶
Takes a value out of a term, keeping the term model out of the caller's code.
Each function answers None when the term is of another kind, or when there
is no term at all, so a lookup and the read that follows are one expression
and two clauses:
match ErlangValues.integer(config.get(ErlangBinary("timeout")))
| let timeout: I64 => use(timeout)
| None => use(5_000)
end
Nothing here casts: the type is known once the second clause is reached, and
a value of the wrong kind is a None rather than an error.
Constructors¶
create¶
Returns¶
- ErlangValues val^
Public Functions¶
atom_name¶
The name of an atom.
Parameters¶
- term: (ErlangTerm | None val)
Returns¶
bytes¶
The bytes of a binary, as they arrived.
Parameters¶
- term: (ErlangTerm | None val)
Returns¶
chars¶
The bytes of a string, which is a charlist on the wire.
Parameters¶
- term: (ErlangTerm | None val)
Returns¶
integer¶
The value of an integer that fits into 64 bits.
A wider integer is an ErlangBigInteger and answers None here; read it
through decimal() instead of narrowing it silently.
Parameters¶
- term: (ErlangTerm | None val)
Returns¶
float¶
The value of a float.
Parameters¶
- term: (ErlangTerm | None val)
Returns¶
pid¶
The pid itself, ready to send to.
Parameters¶
- term: (ErlangTerm | None val)
Returns¶
eq¶
Parameters¶
- that: ErlangValues val
Returns¶
- Bool val
ne¶
Parameters¶
- that: ErlangValues val
Returns¶
- Bool val