Behaviours: riakc_datatype.
Encapsulates a gset data-type. Riak's gsets differ from Erlang set types in several ways:
add_element/2
)
is not applied to local state. Instead, additions 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.gset_op() = simple_gset_op() | {update, [simple_gset_op()]}
abstract datatype: riakc_gset()
simple_gset_op() = {add_all, [binary()]}
add_element/2 | Adds an element to 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 gset container. |
new/0 | Creates a new, empty set container type. |
new/1 | Creates a new sset container with the opaque context. |
new/2 | Creates a new gset 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 gset 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(), Gset::riakc_gset()) -> riakc_gset()
Adds an element to the set.
fold(Fun::fun((binary(), term()) -> term()), Acc0::term(), Gset::riakc_gset()) -> term()
Folds over the members of the set. Note: this only operates on the original value as retrieved from Riak.
is_element(Bin::binary(), Gset::riakc_gset()) -> 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 gset container.
new() -> riakc_gset()
Creates a new, empty set container type.
new(Context::riakc_datatype:context()) -> riakc_gset()
Creates a new sset container with the opaque context.
new(Value::[binary()], Context::riakc_datatype:context()) -> riakc_gset()
Creates a new gset container with the given members and opaque context.
size(Gset::riakc_gset()) -> pos_integer()
Returns the cardinality (size) of the set. Note: this only operates on the original value as retrieved from Riak.
to_op(Gset::riakc_gset()) -> riakc_datatype:update(gset_op())
Extracts an operation from the gset that can be encoded into an update request.
type() -> atom()
Returns the symbolic name of this container.
value(Gset::riakc_gset()) -> ordsets:ordset(binary())
Returns the original value of the set as an ordset.
Generated by EDoc, Dec 16 2016, 16:38:08.