Patches and Fragment
Patches<S> is what a handler returns: new signal values and re-rendered fragments, which the browser applies in order.
Patches
| Item | Summary |
|---|---|
Patches::new | An empty batch. |
signals | Sets signals in the browser. |
list | Changes items of list signals in the browser, sending only the items that change. |
all_signals | Replaces every signal with the values in signals. |
element | Re-renders fragment and morphs it into the element with its id. |
navigate | Loads the page at url once the patches before it are applied. |
push_url | Shows url in the address bar as a new history entry, without loading it. |
replace_url | Shows url in the address bar in place of the current URL, without loading it. |
to_event_stream | The batch as a Server-Sent Events body, for use without the axum feature. |
value_of | The value the batch leaves signal at, for a test of an action. |
navigates_to | The URL of the first navigate in the batch, for a test. |
replaces | Whether the batch re-renders the fragment F, for a test. |
SignalPatch | New values for one or more signals of S. |
SignalPatch::and | Adds the values in other. A signal present in both takes other's value. |
ListPatch | Item changes to list signals of S, sent without the rest of each list. |
ListPatch::and | Adds the changes in other, applied after the ones in self. |
Fragment
| Item | Summary |
|---|---|
Fragment | A part of the page that the server can re-render and replace without the rest of the page. |
Fragment::ID | The element id of the fragment's root. |
Fragment::render | Renders the fragment's root element. |
fragment | Renders fragment with its root id set to Fragment::ID. |