日本語

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

ItemSummary
SignalsA struct whose fields are signals.
SigA typed reference to a signal of type T inside the signal struct S.
ItemThe current item of a list, inside each or a list predicate such as Sig::count.
RootMarks a Sig whose path starts at the page's signal struct.
LocalMarks a Sig whose path starts at the current item of an each or a list predicate.
PartA piece of page written once against its own signals, which any page can embed.
Part::renderRenders the part, with its paths written under the field it is embedded at.
MAX_DEPTHThe deepest chain of fields a Sig can name.

Sig

A Sig is also an expression, so the methods of Expr apply to it.

ItemSummary
atThe field field of the struct this signal holds.
setA statement that assigns value to this signal in the browser.
toggleA statement that flips this flag.
patchA patch that sets this signal to value when the server sends it.
pathThe dotted field path this signal is stored under.
let_in_stmtA statement that runs body with this signal's value when the statement runs.

Lists

These exist on a Sig whose value is a Vec.

ItemSummary
pushA statement that appends value to this list.
appendA statement that appends every item of items to this list.
prependA statement that adds every item of items before the items of this list.
patch_appendA patch that adds items after the items the browser holds.
patch_prependA patch that adds items before the items the browser holds.
patch_upsertA patch that replaces items by key and appends those with new keys.
patch_removeA patch that removes each item whose key is one of keys.
extendA statement that appends count items, building each from its position i.
remove_atA statement that removes the item at index, if there is one.
clearA statement that empties this list.
retainA statement that keeps only the items for which keep is true.
set_allA statement that sets field to value on every item.
update_whereA statement that sets field to value on the items for which when is true.
swapA statement that exchanges the items at a and b, if both exist.
sort_byA statement that orders the items by key, ascending, keeping the order of equal keys.
sort_by_descA statement that orders the items by key, descending, keeping the order of equal keys.
countThe number of items for which matches is true.
mapThe list of what value gives for each item, in order.
sum_ofThe sum of value over the items, 0 for an empty list.
max_ofThe largest value over the items, or None for an empty list.
min_ofThe smallest value over the items, or None for an empty list.

Item

ItemSummary
atThe field field of the item.
valueThe item itself, as a signal that can be read and written.
indexThe item's position in its list, starting at 0.
removeA statement that removes this item from its list.