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

Structure representing a URI extracted from a document.

Matches the Rust `Uri` struct.

## Fields

  * `:url` - The URL string
  * `:label` - Optional display label for the URI
  * `:page` - Optional page number where the URI appears
  * `:kind` - The kind of URI (e.g., "hyperlink", "image", "anchor")

# `t`

```elixir
@type t() :: %Kreuzberg.Uri{
  kind: String.t(),
  label: String.t() | nil,
  page: integer() | nil,
  url: String.t()
}
```

# `from_map`

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

Creates a Uri struct from a map.

## Examples

    iex> Kreuzberg.Uri.from_map(%{
    ...>   "url" => "https://example.com",
    ...>   "label" => "Example",
    ...>   "page" => 1,
    ...>   "kind" => "hyperlink"
    ...> })
    %Kreuzberg.Uri{
      url: "https://example.com",
      label: "Example",
      page: 1,
      kind: "hyperlink"
    }

# `to_map`

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

Converts a Uri struct to a map.

## Examples

    iex> uri = %Kreuzberg.Uri{url: "https://example.com", kind: "hyperlink"}
    iex> Kreuzberg.Uri.to_map(uri)
    %{
      "url" => "https://example.com",
      "label" => nil,
      "page" => nil,
      "kind" => "hyperlink"
    }

---

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