HashDict

Introduction #

A key-value store.

The HashDict is represented internally as a struct, therefore %HashDict{} can be used whenever there is a need to match on any HashDict. Note though the struct fields are private and must not be accessed directly. Instead, use the functions on this or in the Dict module.

Implementation-wise, HashDict is implemented using tries, which grows in space as the number of keys grows, working well with both small and large set of keys. For more information about the functions and their APIs, please consult the Dict module.

Source

Types #

t

Functions #

delete(dict, key)

Callback implementation of Dict.delete/2.

drop(dict, keys)

Callback implementation of Dict.drop/2.

equal?(dict1, dict2)

Callback implementation of Dict.equal?/2.

fetch(hashdict, key)

Callback implementation of Dict.fetch/2.

fetch!(dict, key)

Callback implementation of Dict.fetch!/2.

get(dict, key, default \\ nil)

Callback implementation of Dict.get/3.

has_key?(dict, key)

Callback implementation of Dict.has_key?/2.

keys(dict)

Callback implementation of Dict.keys/1.

merge(dict1, dict2, fun \\ fn _k, _v1, v2 -> v2 end)

Callback implementation of Dict.merge/3.

new()

Specs

Creates a new empty dict.

pop(dict, key, default \\ nil)

Callback implementation of Dict.pop/3.

put(hashdict, key, value)

Callback implementation of Dict.put/3.

put_new(dict, key, value)

Callback implementation of Dict.put_new/3.

size(hashdict)

Callback implementation of Dict.size/1.

split(dict, keys)

Callback implementation of Dict.split/2.

take(dict, keys)

Callback implementation of Dict.take/2.

to_list(dict)

Callback implementation of Dict.to_list/1.

update(dict, key, initial, fun)

Callback implementation of Dict.update/4.

update!(dict, key, fun)

Callback implementation of Dict.update!/3.

values(dict)

Callback implementation of Dict.values/1.