Behaviours: riakc_datatype.
Encapsulates a set data-type. Riak's sets differ from Erlang set types in several ways:
add_element/2
and del_element/2
) are not applied to local
state. Instead, additions and removals are captured for later
application by Riak.size/1
, is_element/1
and fold/3
only
operate on the original value of the set, disregarding local
updates.abstract datatype: riakc_set()
set_op() = simple_set_op() | {update, [simple_set_op()]}
simple_set_op() = {add_all, [binary()]} | {remove_all, [binary()]}
add_element/2 | Adds an element to the set. |
add_elements/2 | Adds elements to the set. |
del_element/2 | Removes an element from the set. |
fold/3 | Folds over the members of the set. |
is_element/2 | Test whether an element is a member of the set. |
is_type/1 | Determines whether the passed term is a set container. |
new/0 | Creates a new, empty set container type. |
new/1 | Creates a new set container with the opaque context. |
new/2 | Creates a new set container with the given members and opaque context. |
size/1 | Returns the cardinality (size) of the set. |
to_op/1 | Extracts an operation from the set that can be encoded into an update request. |
type/0 | Returns the symbolic name of this container. |
value/1 | Returns the original value of the set as an ordset. |
add_element(Bin::binary(), Set::riakc_set()) -> riakc_set()
Adds an element to the set.
add_elements(Elems::[binary()], Set::riakc_set()) -> riakc_set()
Adds elements to the set.
del_element(Bin::binary(), Set::riakc_set()) -> riakc_set()
throws context_required
Removes an element from the set.
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(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(T::term()) -> boolean()
Determines whether the passed term is a set container.
new() -> riakc_set()
Creates a new, empty set container type.
new(Context::riakc_datatype:context()) -> riakc_set()
Creates a new set container with the opaque context.
new(Value::[binary()], Context::riakc_datatype:context()) -> riakc_set()
Creates a new set container with the given members and opaque context.
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(Set::riakc_set()) -> riakc_datatype:update(set_op())
Extracts an operation from the set that can be encoded into an update request.
type() -> atom()
Returns the symbolic name of this container.
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.