Expand description
Values behind an Arc that cross once, then by key.
The map side and a worker instance exchange many messages that refer to
the same values: every tile’s layout job has its source’s style, its
layers and their expressions, and every layout the worker sends back has
buckets whose binders hold those expressions again. A Kind names such
a value type, and the fields that hold one opt in with ByKey
(#[wire(with = ...)]) or write() and read(). Each side keeps a
Table of each kind it shares, and while a message is written or read
with a kind’s table in its context, a value is written as follows:
- On the side the value comes from (
Role::Origin), the first time as a definition under a new key, then as the key. That side keeps the key while the value lives (a weak reference), so the other side can refer to the value by it too, and lists the keys of the values that died (ErasedTable::forget_dead) for the other side to drop. - On the side that gets it (
Role::Copies), the definition makes the value and keeps it under its key until it is forgotten. Sending that value back writes its key, and the origin reads its own value again. A value of this side’s own is written in full.
Without its kind’s table in the context, a value is written in full.
Structs§
- ByKey
#[wire(with = "shared::ByKey::<K>")]for anArcof a value of kindK:write()andread().- Table
- One side’s table of the values of kind
K. A message written or read with it in its context (Context) refers to them by key.
Enums§
- Role
- Which side of a kind’s values a table is.
Traits§
- Erased
Table - A table of any kind, as a side keeps its tables together.
- Kind
- A type of value that crosses once, then by key, and how it is written in full.
Functions§
- read
- Reads what
writewrote. - read_
option - Reads what
write_optionwrote. - write
- Writes a value of kind
K. - write_
option - Writes an
Optionof a value of kindK.