Expand description
Typed dispatch for AppData components.
Defines the Component trait that pairs a static ComponentId
with a value type, encoding, and per-component validation hooks.
Each well-known component (GROUP_NAME, ADMIN_LIST, etc.) has one
Component impl living under app_data::components::*. Together
with the static dispatch table in app_data::registry_table, the
trait is the single source of truth for what a ComponentId
means at the byte level.
§Type erasure
Component has only static methods (no &self), so dyn Component
cannot be formed. The companion ErasedComponent trait is the
object-safe shape used for runtime dispatch. A blanket impl over any
C: Component + Send + Sync + 'static lets each Component impl be a
zero-sized type — &'static dyn ErasedComponent is a single
pointer with no per-call boxing.
§Bytes-out, value-out boundary
The trait deliberately splits “byte-in / byte-out” methods (which
survive type erasure) from “value-in / value-out” methods (which
require the static Self::Value / Self::Mutation types).
Validators and the steady-state apply path use the byte-shaped
methods through &dyn ErasedComponent; reads against a known
component impl use decode_value directly with the static type
through the MlsGroupAppData facade in xmtp_mls.
Structs§
- Expanded
Component Change - A single per-element view of an incoming
AppDataUpdateproposal.
Enums§
- Component
Invariant Error - Errors surfaced by
Component::validate_invariant. - Component
Typed Error - Errors surfaced by
Componenttrait methods.
Traits§
- Component
- A typed view of a well-known AppData component.
- Erased
Component - Object-safe view of a
Componentimpl, for runtime dispatch via&'static dyn ErasedComponent. Carries only the byte-shaped methods — typed reads throughdecode_value/encode_value/encode_mutationneed the staticSelf::Value/Self::Mutationtypes and aren’t reachable through the dyn boundary.