exts v0.3.4 Exts

Summary

Functions

Get all the present tables, see ets:all

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

Clear the given table, see ets:delete_all_objects

Get the number of terms in the given table

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

Delete the term matching the given pattern or key in the given table, see ets:select_delete and ets:delete

Delete the given term from the given table, see ets:delete_object

Destroy the given table, see ets:delete

Dump the given table to the given file, see ets:tab2file

Dump the given table to the given file, raising if there’s any problem doing so, see ets:tab2file

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

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

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

Give the given table to the given process, see ets:give_away

Get information about the given table or table saved on file, see ets:info and ets:tabfile_info

Get specific information about the given table and given topic, see ets:info

Get the keys in the given table

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

Load a table from the given file, see ets:file2tab

Load a table from the given file, raising if there’s any problem doing so, see ets:file2tab

Match terms from the given 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 unnamed table with the default options, see ets:new

Create a new unnamed table with the given options, see ets:new

Create a new named table with the given options, see ets:new

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

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

Read the given term from the given table, see ets:lookup

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

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

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

Convert the given table to a list of terms, see ets:tab2list

Write the given term to the given table optionally disabling overwriting, see ets:insert and ets:insert_new

Types

table()
table() :: integer | atom

Functions

all()
all() :: [table]

Get all the present tables, see ets:all.

at(table, slot)
at(table, integer) :: [term]

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

clear(table)
clear(table) :: true

Clear the given table, see ets:delete_all_objects.

count(table)
count(table) :: non_neg_integer

Get the number of terms in the given table.

count(table, match_spec)
count(table, any) :: non_neg_integer

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

delete(table, match_spec)
delete(table, any) :: true | integer

Delete the term matching the given pattern or key in the given table, see ets:select_delete and ets:delete.

delete!(table, object)
delete!(table, term) :: true

Delete the given term from the given table, see ets:delete_object.

destroy(table)
destroy(table) :: true

Destroy the given table, see ets:delete.

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

Dump the given table to the given file, see ets:tab2file.

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

Dump the given table to the given file, raising if there’s any problem doing so, see ets:tab2file.

first(table)
first(table) :: any | nil

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

foldl(table, acc, fun)
foldl(table, any, (term, any -> any)) :: any

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

foldr(table, acc, fun)
foldr(table, any, (term, any -> any)) :: any

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

give_to(table, pid, data \\ nil)
give_to(table, pid, any) :: true

Give the given table to the given process, see ets:give_away.

info(path)
info(String.t | table) ::
  {:ok, any} |
  {:error, any} |
  Keyword.t |
  nil

Get information about the given table or table saved on file, see ets:info and ets:tabfile_info.

info(table, key)
info(table, atom) :: any | nil

Get specific information about the given table and given topic, see ets:info.

keys(table)
keys(table) :: [term]

Get the keys in the given table.

last(table)
last(table) :: any | nil

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

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

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

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

Load a table from the given file, raising if there’s any problem doing so, see ets:file2tab.

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

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

match(table, pattern, list)
match(table, any | integer, Keyword.t | any) ::
  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() :: table

Create a new unnamed table with the default options, see ets:new.

new(options)
new(Keyword.t) :: table

Create a new unnamed table with the given options, see ets:new.

new(name, options)
new(atom, Keyword.t) :: table

Create a new named table with the given options, see ets:new.

Options

  • :index sets the position of the key in the tuple, default is 0.
  • :concurrency can be either :both, :write or :read, it sets :write_concurrency and :read_concurrency appropriately.
  • :type can either be :set, :ordered_set, :bag or :duplicate_bag, default is :set
  • :access can either be :public, :protected, :private, default is :protected.
  • :heir sets a heir for the table, see the documentation of ets:new, default is none.
  • :compressed can be either true or false, default is false
next(table, key)
next(table, any) :: any | nil

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

prev(table, key)
prev(table, any) :: any | nil

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

read(table, key)
read(table, any) :: [term]

Read the given term from the given table, see ets:lookup.

rename(table, name)
rename(table, atom) :: atom

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

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

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

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

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

to_list(table)
to_list(table) :: [term]

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

write(table, object, options \\ [])
write(table, term, Keyword.t) :: boolean

Write the given term to the given table optionally disabling overwriting, see ets:insert and ets:insert_new.