Aerospike.Exp.Bit (Aerospike Driver v0.3.1)

Copy Markdown View Source

Bit expression helpers for blob expressions.

Summary

Types

Bit expression modify options.

t()

Opaque server-side expression.

Functions

Adds value to a sub-integer in the bitmap.

Applies bitwise AND of value into the selected bit range.

Inverts the selected bit range.

Applies bitwise OR of value into the selected bit range.

Applies bitwise XOR of value into the selected bit range.

Returns the count of bits set to 1 in the selected range.

Returns the selected bits as a blob expression.

Reads an integer from the selected bit range, optionally as signed.

Inserts a byte-string expression at byte_offset.

Returns the offset of the first matching bit when scanning left to right.

Left shifts the selected bit range by shift bits.

Removes byte_size bytes starting at byte_offset.

Resizes the blob expression to byte_size bytes using resize_flags.

Returns the offset of the first matching bit when scanning right to left.

Right shifts the selected bit range by shift bits.

Overwrites a bit range with bits from value.

Writes integer value into the selected bit range.

Subtracts value from a sub-integer in the bitmap.

Types

opts()

@type opts() :: [
  flags: atom() | [atom()] | non_neg_integer() | {:raw, non_neg_integer()},
  overflow_action: atom() | non_neg_integer() | {:raw, non_neg_integer()},
  signed: boolean()
]

Bit expression modify options.

Supported keys:

  • :flags - bit-operation write flags. Defaults to :default.
  • :overflow_action - overflow behavior for add/5 and subtract/5.
  • :signed - when true, adds the signed flag to :overflow_action.

t()

@type t() :: Aerospike.Exp.t()

Opaque server-side expression.

Functions

add(bin, bit_offset, bit_size, value, opts \\ [])

Adds value to a sub-integer in the bitmap.

Supports flags:, overflow_action:, and signed:.

bw_and(bin, bit_offset, bit_size, value, opts \\ [])

Applies bitwise AND of value into the selected bit range.

bw_not(bin, bit_offset, bit_size, opts \\ [])

@spec bw_not(Aerospike.Exp.t(), Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) :: t()

Inverts the selected bit range.

bw_or(bin, bit_offset, bit_size, value, opts \\ [])

Applies bitwise OR of value into the selected bit range.

bw_xor(bin, bit_offset, bit_size, value, opts \\ [])

Applies bitwise XOR of value into the selected bit range.

count(bin, bit_offset, bit_size)

@spec count(Aerospike.Exp.t(), Aerospike.Exp.t(), Aerospike.Exp.t()) :: t()

Returns the count of bits set to 1 in the selected range.

get(bin, bit_offset, bit_size)

Returns the selected bits as a blob expression.

get_int(bin, bit_offset, bit_size, signed \\ false)

@spec get_int(Aerospike.Exp.t(), Aerospike.Exp.t(), Aerospike.Exp.t(), boolean()) ::
  t()

Reads an integer from the selected bit range, optionally as signed.

insert(bin, byte_offset, value, opts \\ [])

@spec insert(Aerospike.Exp.t(), Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) :: t()

Inserts a byte-string expression at byte_offset.

lscan(bin, bit_offset, bit_size, value)

Returns the offset of the first matching bit when scanning left to right.

lshift(bin, bit_offset, bit_size, shift, opts \\ [])

Left shifts the selected bit range by shift bits.

remove(bin, byte_offset, byte_size, opts \\ [])

@spec remove(Aerospike.Exp.t(), Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) :: t()

Removes byte_size bytes starting at byte_offset.

resize(bin, byte_size, resize_flags \\ :default, opts \\ [])

@spec resize(
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  atom() | [atom()] | non_neg_integer() | {:raw, non_neg_integer()},
  opts()
) :: t()

Resizes the blob expression to byte_size bytes using resize_flags.

rscan(bin, bit_offset, bit_size, value)

Returns the offset of the first matching bit when scanning right to left.

rshift(bin, bit_offset, bit_size, shift, opts \\ [])

Right shifts the selected bit range by shift bits.

set(bin, bit_offset, bit_size, value, opts \\ [])

Overwrites a bit range with bits from value.

set_int(bin, bit_offset, bit_size, value, opts \\ [])

Writes integer value into the selected bit range.

subtract(bin, bit_offset, bit_size, value, opts \\ [])

@spec subtract(
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  opts()
) ::
  t()

Subtracts value from a sub-integer in the bitmap.

Supports flags:, overflow_action:, and signed:.