# `Kreuzberg.CodeSpan`
[🔗](https://github.com/kreuzberg-dev/kreuzberg/blob/main/lib/kreuzberg/code_span.ex#L1)

Byte and line/column span for a code element.

## Fields

  * `:start_byte` - Starting byte offset
  * `:end_byte` - Ending byte offset
  * `:start_line` - Starting line number
  * `:start_column` - Starting column number
  * `:end_line` - Ending line number
  * `:end_column` - Ending column number

# `t`

```elixir
@type t() :: %Kreuzberg.CodeSpan{
  end_byte: non_neg_integer(),
  end_column: non_neg_integer(),
  end_line: non_neg_integer(),
  start_byte: non_neg_integer(),
  start_column: non_neg_integer(),
  start_line: non_neg_integer()
}
```

# `from_map`

```elixir
@spec from_map(map()) :: t()
```

Creates a CodeSpan struct from a map.

## Examples

    iex> Kreuzberg.CodeSpan.from_map(%{"start_byte" => 0, "end_byte" => 42, "start_line" => 1, "start_column" => 0, "end_line" => 3, "end_column" => 5})
    %Kreuzberg.CodeSpan{start_byte: 0, end_byte: 42, start_line: 1, start_column: 0, end_line: 3, end_column: 5}

# `to_map`

```elixir
@spec to_map(t()) :: map()
```

Converts a CodeSpan struct to a map.

---

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