pub struct Bundle {
pub component: Arc<str>,
pub wire_id: String,
pub view: Core,
pub validate: Core,
pub fold: Core,
pub init: Core,
pub defs: BTreeMap<Arc<str>, Core>,
pub command: Schema,
pub optimistic: bool,
}Expand description
A component’s slice: the code, and nothing else.
Fields§
§component: Arc<str>The signal this bundle renders — the component’s name in the program, and what
beck explain render prints.
wire_id: StringThe program’s content-derived command-channel id (§4.3). A client that reconnects to a server running a different program finds out here rather than by sending it a command it cannot decode.
view: Core(state, session) -> Html.
validate: Core(state, proposal) -> Result[list[Event], Rejection].
fold: Core(state, Envelope[Event]) -> state.
init: CoreThe fold’s initial accumulator, as an expression rather than a value: evaluating it is the
kernel’s first act, and a Value would have needed a second encoding for the same thing.
defs: BTreeMap<Arc<str>, Core>Every definition the four roles reach, transitively.
command: SchemaWhat the client may send, resolved: enough to turn a data-b-click attribute into the
Command value validate expects, and to refuse anything else.
optimistic: boolWhether this component’s client may run Bundle::validate and Bundle::fold on what it
holds — see crate::render for what decides it, and why holding the state is the whole
question.