leo_hashtable

leo_hashtable is utilities for storing value as key-value in memory.

References

Description

leo_hashtable is utilities for storing value as key-value in memory

Function Index

all/1 Retrieve all values.
append/3 Append a value.
clear/1 Clear values into the hash-table.
delete/2 Remove a value.
destroy/1 Destroy an instance.
get/2 Retrieve a value by key.
get/3 Retrieve a value by key.
incr/2 Increment a value.
keys/1 Retrieve all keys.
new/0 Create an instance.
new/1 Create an instance.
put/3 Insert a value.

Function Details

all/1

all(Hashtable) -> [any()]

  • Hashtable = pid()

Retrieve all values

append/3

append(Hashtable, K, V) -> ok | {error, any()}

  • Hashtable = pid()
  • K = any()
  • V = any()

Append a value

clear/1

clear(Hashtable) -> ok

  • Hashtable = pid()

Clear values into the hash-table

delete/2

delete(Hashtable, K) -> ok

  • Hashtable = pid()
  • K = any()

Remove a value

destroy/1

destroy(Hashtable) -> true

  • Hashtable = pid()

Destroy an instance

get/2

get(Hashtable, K) -> any()

  • Hashtable = pid()
  • K = any()

Retrieve a value by key

get/3

get(Hashtable, K, DefaultValue) -> any()

  • Hashtable = pid()
  • K = any()
  • DefaultValue = any()

Retrieve a value by key

incr/2

incr(Hashtable, K) -> any()

  • Hashtable = pid()
  • K = any()

Increment a value

keys/1

keys(Hashtable) -> list()

  • Hashtable = pid()

Retrieve all keys

new/0

new() -> pid() | {error, any()}

Create an instance

new/1

new(X1::immutable) -> pid() | {error, any()}

Create an instance

put/3

put(Hashtable, K, V) -> ok

  • Hashtable = pid()
  • K = any()
  • V = any()

Insert a value