# How the API docs are organized

The [API reference](../api/tvision_rs/index.html) is the per-type half of this
site: every public struct, trait, enum, and method, generated by `rustdoc`
straight from the source. The Guide you are reading now explains the *ideas*;
the API reference is where you look up the exact signature. Use the **Guide ⇄
API** toggle in the top bar to move between them, and follow any type name in
the Guide — they link straight into their rustdoc page.

## The module map

The crate is laid out as one module per concern. The reference for a type lives
in the module that owns it, so once you know the layout you can navigate by
guessing. Everything below is re-exported at the crate root as well (so `use
tv::Button` works), but the *documentation* lives in the owning module:

| Module      | What lives there                                              |
| ----------- | ------------------------------------------------------------- |
| `app`       | [`Program`](../api/tvision_rs/app/struct.Program.html), `Application`, the run loop |
| `view`      | the [`View`](../api/tvision_rs/view/trait.View.html) trait, [`ViewState`](../api/tvision_rs/view/struct.ViewState.html), [`Context`](../api/tvision_rs/view/struct.Context.html), `Deferred` |
| `widgets`   | the controls — [`Button`](../api/tvision_rs/widgets/struct.Button.html), check boxes, radio buttons, input lines, labels, list boxes, scroll bars, editors |
| `window`    | [`Window`](../api/tvision_rs/window/struct.Window.html) and its scroll-bar options |
| `dialog`    | dialogs, message boxes, gather/scatter                        |
| `desktop`   | the `Desktop` and its background                              |
| `menu`      | menu bar and pull-down menus                                  |
| `status`    | the status line and its help-context ranges                   |
| `event`     | the [`Event`](../api/tvision_rs/event/enum.Event.html) enum and `Key`             |
| `command`   | [`Command`](../api/tvision_rs/command/struct.Command.html) and `CommandSet`        |
| `theme`     | [`Theme`](../api/tvision_rs/theme/struct.Theme.html) and `Role`                    |
| `keymap`    | configurable key mapping                                      |
| `validate`  | input-line validators                                         |
| `data`      | the `FieldValue` value protocol                               |
| `screen`    | `DrawBuffer`, `Cell`, the cell buffer                          |
| `backend`   | the `Backend` trait, `CrosstermBackend`, `HeadlessBackend`    |

The remaining modules — `capture`, `color`, `frame`, `help`, `text`, `timer` —
hold the supporting machinery the chapters in [How It
Works](../internals/view-tree.md) walk through.

## Finding a type

Three reliable routes:

- **Follow a Guide link.** Every type the Guide names is a link into the
  reference. This is the fastest path when you are reading about a feature.
- **Use the rustdoc search box** (press `S`, or click the search field). Type a
  name — `Button`, `set_value` — and rustdoc jumps straight to it.
- **Start at the [crate root](../api/tvision_rs/index.html)** and drill down by
  module if you want to browse what a concern offers.

## Coming from C++ Turbo Vision?

If you are translating a known `TXxx` class or `cmXxx`/`sfXxx` constant, go via
the [symbol map](symbol-map.md) — it is a terse lookup table from the C++ name to
the `tv::` type, which then links into the reference. The *reasoning* behind each
rename lives in [The Idiomatic Port](../port/faithful.md).
