# `LangExtract.ChunkResult`
[🔗](https://github.com/mdepolli/lang_extract/blob/v0.10.0/lib/lang_extract/chunk_result.ex#L1)

A successfully processed chunk: its byte range in the source and the
spans extracted from it.

The per-chunk success unit yielded by `LangExtract.stream/4`, sibling of
`LangExtract.ChunkError`. Span byte offsets are already adjusted
to the original document, not the chunk.

# `t`

```elixir
@type t() :: %LangExtract.ChunkResult{
  byte_end: non_neg_integer(),
  byte_start: non_neg_integer(),
  spans: [LangExtract.Span.t()],
  usage: LangExtract.Provider.Response.usage() | nil
}
```

# `from_chunk`

```elixir
@spec from_chunk(
  LangExtract.Chunker.Chunk.t(),
  [LangExtract.Span.t()],
  LangExtract.Provider.Response.usage() | nil
) :: t()
```

Builds a result carrying `chunk`'s byte range and the request's usage.

---

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