# hot

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-view/hot/

**module** · [`ferroui-view`](/docs/0.5.0/api/ferroui-view/) · v0.5.0

```rust
module hot
```

Hot reload of the literals of `rsx!` (feature `hot-reload`).

`rsx!` passes each literal it can change at run time (the text of a child,
a number, a text or a character given to an attribute) through [`lit`](/docs/0.5.0/api/ferroui-view/hot/function-lit/),
with the place of the macro and the number of the literal among the
literal tokens of the macro. Without the feature `lit` returns the literal
and costs nothing.

With the feature, [`watch`](/docs/0.5.0/api/ferroui-view/hot/function-watch/) (which `launch` calls) checks the source files
that hold `rsx!` literals several times a second. When a file changes, its
macros are read again (`proc-macro2` with the locations of tokens): a
macro whose tokens are those of the build apart from literals gets the new
literals, and the components that read them run again, so the
reconciler patches the controls and keeps their state. A macro whose
structure changed is reported (`Diagnostic::NeedsRebuild`): it needs a
rebuild. Only components that run again (`rerender`,
`#[component(rerender)]`) and children that follow state run again; a
component that runs once keeps what it built.



[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.View/hot.rs#L1)

## Contents

- [`Site`](/docs/0.5.0/api/ferroui-view/hot/struct-site/) — struct
- [`HotLiteral`](/docs/0.5.0/api/ferroui-view/hot/trait-hotliteral/) — trait
- [`lit`](/docs/0.5.0/api/ferroui-view/hot/function-lit/) — function
- [`watch`](/docs/0.5.0/api/ferroui-view/hot/function-watch/) — function
- [`poll`](/docs/0.5.0/api/ferroui-view/hot/function-poll/) — function
- [`apply_source`](/docs/0.5.0/api/ferroui-view/hot/function-apply_source/) — function

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
