ErlangMap¶
A map, kept as key/value pairs in the order they were encoded.
Equality ignores that order, as Erlang's does: two maps with the same pairs are the same value however they were written, and they hash alike. The order is kept so that printing a map shows the order it arrived in.
Implements¶
Constructors¶
create¶
Parameters¶
- pairs': Array[(ErlangTerm , ErlangTerm)] val
Returns¶
- ErlangMap val^
binary_keyed¶
A map whose keys are binaries, which is how Elixir writes
%{"timeout" => 5000}.
Parameters¶
- entries: Array[(String val , ErlangTerm)] val
Returns¶
- ErlangMap val^
atom_keyed¶
A map whose keys are atoms: #{timeout => 5000}.
Parameters¶
- entries: Array[(String val , ErlangTerm)] val
Returns¶
- ErlangMap val^
Public fields¶
let pairs: Array[(ErlangTerm , ErlangTerm)] val¶
Public Functions¶
size¶
Returns¶
- USize val
eq¶
Parameters¶
- that: ErlangMap val
Returns¶
- Bool val
hash¶
Returns¶
- USize val
get¶
The value under key, or None when the map has no such key.
Keys are compared as Erlang compares them, so a structurally equal key finds its value.
Parameters¶
- key: ErlangTerm
Returns¶
- (ErlangTerm | None val)
get_binary¶
The value under the binary key, which is how Elixir writes map keys.
A binary and an atom of the same name are different keys, so this finds nothing in a map keyed by atoms.
Parameters¶
- key: String val
Returns¶
- (ErlangTerm | None val)
get_atom¶
The value under the atom key, e.g. #{timeout => 5000}.
Parameters¶
- key: String val
Returns¶
- (ErlangTerm | None val)
ne¶
Parameters¶
- that: ErlangMap val
Returns¶
- Bool val