Module riakc_set

Encapsulates a set data-type.

Behaviours: riakc_datatype.

Description

Encapsulates a set data-type. Riak's sets differ from Erlang set types in several ways:

Data Types

riakc_set()

abstract datatype: riakc_set()

set_op()

set_op() = simple_set_op() | {update, [simple_set_op()]}

simple_set_op()

simple_set_op() = {add_all, [binary()]} | {remove_all, [binary()]}

Function Index

add_element/2Adds an element to the set.
add_elements/2Adds elements to the set.
del_element/2Removes an element from the set.
fold/3Folds over the members of the set.
is_element/2Test whether an element is a member of the set.
is_type/1Determines whether the passed term is a set container.
new/0Creates a new, empty set container type.
new/1Creates a new set container with the opaque context.
new/2Creates a new set container with the given members and opaque context.
size/1Returns the cardinality (size) of the set.
to_op/1Extracts an operation from the set that can be encoded into an update request.
type/0Returns the symbolic name of this container.
value/1Returns the original value of the set as an ordset.

Function Details

add_element/2

add_element(Bin::binary(), Set::riakc_set()) -> riakc_set()

Adds an element to the set.

add_elements/2

add_elements(Elems::[binary()], Set::riakc_set()) -> riakc_set()

Adds elements to the set.

del_element/2

del_element(Bin::binary(), Set::riakc_set()) -> riakc_set()

throws context_required

Removes an element from the set.

fold/3

fold(Fun::fun((binary(), term()) -> term()), Acc0::term(), Set::riakc_set()) -> term()

Folds over the members of the set. Note: this only operates on the original value as retrieved from Riak.

is_element/2

is_element(Bin::binary(), Set::riakc_set()) -> boolean()

Test whether an element is a member of the set. Note: this only operates on the original value as retrieved from Riak.

is_type/1

is_type(T::term()) -> boolean()

Determines whether the passed term is a set container.

new/0

new() -> riakc_set()

Creates a new, empty set container type.

new/1

new(Context::riakc_datatype:context()) -> riakc_set()

Creates a new set container with the opaque context.

new/2

new(Value::[binary()], Context::riakc_datatype:context()) -> riakc_set()

Creates a new set container with the given members and opaque context.

size/1

size(Set::riakc_set()) -> pos_integer()

Returns the cardinality (size) of the set. Note: this only operates on the original value as retrieved from Riak.

to_op/1

to_op(Set::riakc_set()) -> riakc_datatype:update(set_op())

Extracts an operation from the set that can be encoded into an update request.

type/0

type() -> atom()

Returns the symbolic name of this container.

value/1

value(Set::riakc_set()) -> ordsets:ordset(binary())

Returns the original value of the set as an ordset.


Generated by EDoc, Dec 16 2016, 16:38:08.