# `Xitdb.Cursor`
[🔗](https://github.com/boxxxie/xitdb-elixir/blob/v1.0.1/lib/xitdb/cursor.ex#L1)

Clojure/Datomic-style lazy cursor representing a 9-byte `Slot` (`tag` + `value`)
in an immutable `xitdb` store.

Because `%Xitdb.Cursor{}` holds only the NIF database resource reference and the
9-byte slot coordinates (`tag`, `tag_id`, `value`), it is a **pure Elixir value**:
- Can be passed across BEAM processes (`Task.async/1`, GenServers, ETS, LiveView assigns)
  with zero mutexes or dangling pointer hazards.
- Implements `Access` (`cursor["key"]`, `cursor[0]`, `get_in/2`, `put_in/3`, `update_in/3`, `pop_in/2`).
- Implements `Enumerable` (`Enum.count/1` in $O(1)$ on counted collections,
  `Enum.member?/2` in $O(1)$ / $O(\log N)$ via HAMT/B+Tree lookup,
  `Enum.slice/2` in $O(\log N)$ via index seek, and `Enum.to_list/1` / `Stream.*`).
- Implements `Inspect` with a safe, bounded preview.

# `t`

```elixir
@type t() :: %Xitdb.Cursor{
  db_ref: reference(),
  deleted_paths: MapSet.t(),
  full: boolean(),
  moment: integer(),
  path_steps: [{atom(), String.t() | integer()}],
  staged_ops: list(),
  staged_overrides: map(),
  tag: atom(),
  tag_id: non_neg_integer(),
  tx_mode: boolean(),
  value: integer()
}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
