Bedrock.ToKeyRange protocol (bedrock v0.5.3)

View Source

Protocol for converting various types to key ranges.

A key range is represented as a tuple {start_key, end_key} where:

  • start_key is inclusive (binary)
  • end_key is exclusive (binary)

This protocol provides a unified interface for range operations in Bedrock, allowing directories, keyspaces, and other types to be used wherever a key range is expected.

Summary

Types

t()

All the types that implement this protocol.

Functions

Converts the given data to a key range tuple.

Types

key_range()

@type key_range() :: {binary(), binary()}

t()

@type t() :: term()

All the types that implement this protocol.

Functions

to_key_range(data)

@spec to_key_range(term()) :: key_range()

Converts the given data to a key range tuple.

Returns a tuple {start_key, end_key} where both are binaries.