Expand description
Host-defined (“custom”) component registration.
Custom components live in the app range (0xC000-0xFEFF,
per ComponentId::is_app_range) and are registered by host
apps at process startup. Unlike well-known components — which
have static Component impls with const ID: ComponentId — a
RuntimeComponent carries its id as a runtime value so a host
can register multiple distinct components from one impl type
parameterized by id (or build them dynamically).
§Lifecycle
- Process startup (host): the host calls
register_global_runtime_componentfor each component it wants to support. The registry stores a&'static dyn ErasedComponent-shaped handle keyed byComponentId. - Dispatch lookup: callers of
super::registry_table::lookup_componentcheck the staticWELL_KNOWNtable first; if no entry exists there and the id is in the app range, the runtime registry is consulted. - Per-group registration: registering a custom component in
a group’s
COMPONENT_REGISTRYhappens viaIntentKind::UpdatePermission(post-bootstrap), separately from the host-process registration here. Both must happen before a group can carry a custom component’s value: the host needs aRuntimeComponentimpl to decode the bytes, and the group needs a registry entry so writes passvalidate_component_write.
§Why a global rather than per-Client
Threading a per-Client registry through every dispatch site
(apply_app_data_update_payload, expand_app_data_update_to_changes,
validate_component_write, the facade) would touch ~dozens of
call shapes. A process-global registry keeps the dispatch
signature stable and reflects the operational reality: hosts
register their custom-component shapes once, at process startup,
before any group is created. There is no use case for “different
Clients in the same process know different custom components.”
Enums§
- Runtime
Registration Error - Errors surfaced by
register_global_runtime_component.
Traits§
- Runtime
Component - A host-defined component whose
ComponentIdis known at runtime.
Functions§
- register_
global_ runtime_ component - Register a host-defined runtime component.