Expand description
Static dispatch table for well-known [Component] impls.
Maps each well-known ComponentId to its zero-sized
ErasedComponent impl so dispatch sites can resolve a runtime
ComponentId to the right per-component logic without per-call
boxing. The table is hand-maintained and sorted by
ComponentId::as_u16() so lookup_component does a single
binary search.
§Adding a new well-known component
- Add a
Componentimpl inapp_data::components::*. - Insert a
(ComponentId::FOO, &FooComponent)entry intoWELL_KNOWN, maintaining ascending sort order. - The compile-time
assert_table_is_sorted_and_uniquecheck at the bottom of this file verifies invariants on every build.
Application-range components have no entry and no process-local handler: every client decodes them with the standard codec for the type in the group’s committed registry, so no local code can change which commits a client accepts.
Statics§
- WELL_
KNOWN - Sorted-ascending table of
(ComponentId, &dyn ErasedComponent)entries for every well-known XMTP component.
Functions§
- lookup_
component - Look up the well-known
ErasedComponentfor aComponentId.