cell

Types

pub opaque type Cell(value)

An table of cells.

Internally this is an Erlang ETS table, so when the process that created table terminates the table is dropped.

pub type Table

Values

pub fn delete(cell: Cell(value)) -> Result(Nil, Nil)

Delete the value from a cell, freeing the memory used.

pub fn drop(table: Table) -> Nil

Drop a table, freeing the memory it used.

Any attempt to use a table after it was dropped will result in an error.

pub fn new(table: Table) -> Cell(value)

Create a new cell.

If the table the cell is part of to is dropped then the cell will no longer be usable.

pub fn new_table() -> Table

Create a new table.

The process that calls this function is the owner of the ETS table, and the table will be dropped when the owner process terminates.

pub fn read(cell: Cell(value)) -> Result(value, Nil)

Read the current value contained by a cell.

This function will return an error if the table has been dropped, or if the cell does not yet have a value.

pub fn write(cell: Cell(value), value: value) -> Result(Nil, Nil)

Set the value of a cell, overwriting any previous value.

This function will return an error if the table has been dropped.

Search Document