# `PgRest.Request.Range`
[🔗](https://github.com/agoodway/pgrest/blob/v0.2.0/lib/pg_rest/request/range.ex#L1)

Combines the `Range` header with the `limit`/`offset` query parameters into a
single `%{offset, limit}`, porting PostgREST's `getRanges`.

Ranges are inclusive `{lower, upper}` row intervals where `upper` may be
`:inf`. The header range is intersected with the limit/offset range; an empty
result is a 416 `PGRST103`, except for the special `limit=0` range
`{0, -1}` which means "no rows". Only GET honors the `Range` header (HEAD does
not), as recorded from PostgREST.

# `t`

```elixir
@type t() :: %{offset: non_neg_integer(), limit: non_neg_integer() | nil}
```

# `from`

```elixir
@spec from(String.t(), [{String.t(), String.t()}], [{String.t(), String.t()}]) ::
  {:ok, t()} | {:error, PgRest.Error.t()}
```

Computes the effective offset and limit for a request.

---

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