Signals and Sig
Signals is the trait the page's state struct implements, and Sig<S, T> is a typed reference to one of its fields.
Types
| Item | Summary |
|---|---|
Signals | A struct whose fields are signals. |
Sig | A typed reference to a signal of type T inside the signal struct S. |
Item | The current item of a list, inside each or a list predicate such as Sig::count. |
Root | Marks a Sig whose path starts at the page's signal struct. |
Local | Marks a Sig whose path starts at the current item of an each or a list predicate. |
Part | A piece of page written once against its own signals, which any page can embed. |
Part::render | Renders the part, with its paths written under the field it is embedded at. |
MAX_DEPTH | The deepest chain of fields a Sig can name. |
Sig
A Sig is also an expression, so the methods of Expr apply to it.
| Item | Summary |
|---|---|
at | The field field of the struct this signal holds. |
set | A statement that assigns value to this signal in the browser. |
toggle | A statement that flips this flag. |
patch | A patch that sets this signal to value when the server sends it. |
path | The dotted field path this signal is stored under. |
let_in_stmt | A statement that runs body with this signal's value when the statement runs. |
Lists
These exist on a Sig whose value is a Vec.
| Item | Summary |
|---|---|
push | A statement that appends value to this list. |
append | A statement that appends every item of items to this list. |
prepend | A statement that adds every item of items before the items of this list. |
patch_append | A patch that adds items after the items the browser holds. |
patch_prepend | A patch that adds items before the items the browser holds. |
patch_upsert | A patch that replaces items by key and appends those with new keys. |
patch_remove | A patch that removes each item whose key is one of keys. |
extend | A statement that appends count items, building each from its position i. |
remove_at | A statement that removes the item at index, if there is one. |
clear | A statement that empties this list. |
retain | A statement that keeps only the items for which keep is true. |
set_all | A statement that sets field to value on every item. |
update_where | A statement that sets field to value on the items for which when is true. |
swap | A statement that exchanges the items at a and b, if both exist. |
sort_by | A statement that orders the items by key, ascending, keeping the order of equal keys. |
sort_by_desc | A statement that orders the items by key, descending, keeping the order of equal keys. |
count | The number of items for which matches is true. |
map | The list of what value gives for each item, in order. |
sum_of | The sum of value over the items, 0 for an empty list. |
max_of | The largest value over the items, or None for an empty list. |
min_of | The smallest value over the items, or None for an empty list. |