# `WardrikEvents.Cursor`

Encodes and decodes cursors. A cursor is the last sequence number read in each log.

# `t`

```elixir
@type t() :: %{required(String.t()) =&gt; non_neg_integer()}
```

The last sequence number read, by log.

# `decode`

```elixir
@spec decode(String.t()) :: {:ok, t()} | {:error, :invalid_cursor}
```

Decodes text from `encode/1`. Returns `{:error, :invalid_cursor}` if it isn't a cursor.

# `encode`

```elixir
@spec encode(t()) :: String.t()
```

Encodes a cursor as URL-safe text, for `:after`.

---

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