exts v0.3.4 Exts.Dict

Summary

Functions

Read the terms in the given slot, see ets:slot

Check if the table is a bag

Clear the contents of the table, see ets:delete_all_objects

Get the number of terms in the table

Count the number of terms matching the match_spec, see ets:select_count

Delete the term matching the given match_spec or key, see ets:select_delete and ets:delete

Destroy the table, see ets:delete

Dump the table to a file

Dump the table to a file, raising if there’s a problem while doing so

Check if the table is a duplicate bag

Get the first key in table, see ets:first

Fold the table from the left, see ets:foldl

Fold the table from the right, see ets:foldr

Give the table to another process, optionally passing data to give to the process, see ets:give_away

Get info about the table, see ets:info

Get info about the table, see ets:info

Get the last key in the table, see ets:last

Load a table from a file, see ets:file2tab

Load a table from a file, raising if there’s a problem with the file, see ets:file2tab

Match terms from the table with the given pattern, see ets:match

Match terms from the given table with the given pattern and options, see ets:match

Create a new table with default options

Wrap a table or create one with the passed options

Get the next key in the table, see ets:next

Check if the table is an ordered set

Get the previous key in the table, see ets:prev

Protect a table for safe iteration

Rename the table to the given atom, see ets:rename

Select terms in the table using a match_spec, traversing in reverse, see ets:select_reverse

Select terms in the table using a match_spec, see ets:select

Check if the table is a set

Convert the table to a list, see ets:tab2list

Unprotect a table from safe iteration

Types

t()
t

Functions

at(dict, slot)
at(integer, t) :: [term]

Read the terms in the given slot, see ets:slot.

bag?(dict)
bag?(t) :: boolean

Check if the table is a bag.

clear(dict)
clear(t) :: true

Clear the contents of the table, see ets:delete_all_objects.

count(dict)
count(t) :: non_neg_integer

Get the number of terms in the table.

count(dict, spec)
count(t, any) :: non_neg_integer

Count the number of terms matching the match_spec, see ets:select_count.

delete(dict, key_or_pattern)
delete(t, any) :: true

Delete the term matching the given match_spec or key, see ets:select_delete and ets:delete.

destroy(dict)
destroy(t) :: true

Destroy the table, see ets:delete.

dump(dict, path, options \\ [])
dump(String.t, Keyword.t, t) :: :ok | {:error, any}

Dump the table to a file.

dump!(path, options \\ [], self)
dump!(String.t, Keyword.t, t) :: :ok | no_return

Dump the table to a file, raising if there’s a problem while doing so.

duplicate_bag?(dict)
duplicate_bag?(t) :: boolean

Check if the table is a duplicate bag.

fetch(dict, key)
first(dict)
first(t) :: any

Get the first key in table, see ets:first.

foldl(dict, acc, fun)
foldl(t, any, (term, any -> any)) :: any

Fold the table from the left, see ets:foldl.

foldr(dict, acc, fun)
foldr(t, any, (term, any -> any)) :: any

Fold the table from the right, see ets:foldr.

give_to(dict, pid, data \\ nil)
give_to(t, pid, any) :: true

Give the table to another process, optionally passing data to give to the process, see ets:give_away.

info(dict)
info(t) :: [any] | nil

Get info about the table, see ets:info.

info(dict, key)
info(atom, t) :: any | nil

Get info about the table, see ets:info.

keys(self)
last(dict)
last(t) :: any

Get the last key in the table, see ets:last.

load(path, options \\ [])
load(String.t, Keyword.t) :: {:ok, t} | {:error, any}

Load a table from a file, see ets:file2tab.

load!(path, options \\ [])
load!(String.t, Keyword.t) :: t | no_return

Load a table from a file, raising if there’s a problem with the file, see ets:file2tab.

match(dict, pattern)
match(t, any) :: Exts.Selection.t | nil

Match terms from the table with the given pattern, see ets:match.

match(dict, pattern, options)
match(t, any, Keyword.t) :: Exts.Selection.t | nil

Match terms from the given table with the given pattern and options, see ets:match.

Options

  • :whole when true it returns the whole term.
  • :delete when true it deletes the matching terms instead of returning them.
  • :limit the amount of elements to select at a time.
new()
new() :: t

Create a new table with default options.

new(options)
new(integer | atom | Keyword.t) :: t

Wrap a table or create one with the passed options.

next(dict, key)
next(any, t) :: any

Get the next key in the table, see ets:next.

ordered_set?(dict)
ordered_set?(t) :: boolean

Check if the table is an ordered set.

prev(dict, key)
prev(any, t) :: any

Get the previous key in the table, see ets:prev.

protect(dict)
protect(t) :: none

Protect a table for safe iteration.

put(self, key, value)
rename(name, dict)
rename(atom, t) :: atom

Rename the table to the given atom, see ets:rename.

reverse_select(dict, match_spec, options \\ [])

Select terms in the table using a match_spec, traversing in reverse, see ets:select_reverse.

select(dict, match_spec, options \\ [])
select(t, any, Keyword.t) :: Exts.Selection.t | nil

Select terms in the table using a match_spec, see ets:select.

set?(dict)
set?(t) :: boolean

Check if the table is a set.

to_list(dict)
to_list(t) :: [term]

Convert the table to a list, see ets:tab2list.

unprotect(dict)
unprotect(t) :: none

Unprotect a table from safe iteration.

values(self)