bravo/object

This module provides the Object type and functions that use it. Objects are essential to accessing any ETS table.

Types

Represents an object in an ETS table. Functionally, this is simply a wrapper around arbitrary tuples.

pub opaque type Object(a)

Functions

pub fn element(object: Object(a), index: Int) -> Option(Dynamic)

Gets the nth element of an Object (currently 1-indexed but this may change). Fails if the index is out of range.

pub fn extract(object: Object(a)) -> Dynamic

Creates a Dynamic from the data stored inside an Object. This should always be a tuple.

pub fn new(tuple: a) -> Object(a)

Creates a new Object from a tuple. Passing in a non-tuple may result in unexpected behavior.

pub fn size(object: Object(a)) -> Int

Get the number of elements in an Object.

Search Document