exts v0.3.2 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

Functions

at(dict, slot)

Specs

at(integer, t) :: [term]

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

bag?(dict)

Specs

bag?(t) :: boolean

Check if the table is a bag.

clear(dict)

Specs

clear(t) :: true

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

count(dict)

Specs

count(t) :: non_neg_integer

Get the number of terms in the table.

count(dict, spec)

Specs

count(t, any) :: non_neg_integer

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

delete(dict, key_or_pattern)

Specs

delete(t, any) :: true

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

destroy(dict)

Specs

destroy(t) :: true

Destroy the table, see ets:delete.

dump(dict, path, options \\ [])

Specs

dump(String.t, Keyword.t, t) :: :ok | {:error, any}

Dump the table to a file.

dump!(path, options \\ [], self)

Specs

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)

Specs

duplicate_bag?(t) :: boolean

Check if the table is a duplicate bag.

fetch(dict, key)
first(dict)

Specs

first(t) :: any

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

foldl(dict, acc, fun)

Specs

foldl(t, any, (term, any -> any)) :: any

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

foldr(dict, acc, fun)

Specs

foldr(t, any, (term, any -> any)) :: any

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

give_to(dict, pid, data \\ nil)

Specs

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)

Specs

info(t) :: [any] | nil

Get info about the table, see ets:info.

info(dict, key)

Specs

info(atom, t) :: any | nil

Get info about the table, see ets:info.

keys(self)
last(dict)

Specs

last(t) :: any

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

load(path, options \\ [])

Specs

load(String.t, Keyword.t) ::
  {:ok, t} |
  {:error, any}

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

load!(path, options \\ [])

Specs

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)

Specs

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

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

match(dict, pattern, options)

Specs

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()

Specs

new :: t

Create a new table with default options.

new(options)

Specs

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

Wrap a table or create one with the passed options.

next(dict, key)

Specs

next(any, t) :: any

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

ordered_set?(dict)

Specs

ordered_set?(t) :: boolean

Check if the table is an ordered set.

prev(dict, key)

Specs

prev(any, t) :: any

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

protect(dict)

Specs

protect(t) :: none

Protect a table for safe iteration.

put(self, key, value)
rename(name, dict)

Specs

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 \\ [])

Specs

select(t, any, Keyword.t) :: Exts.Selection.t | nil

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

set?(dict)

Specs

set?(t) :: boolean

Check if the table is a set.

to_list(dict)

Specs

to_list(t) :: [term]

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

unprotect(dict)

Specs

unprotect(t) :: none

Unprotect a table from safe iteration.

values(self)