Expand description
Typed metadata fields: the developer-facing view of a group’s AppData dictionary.
xmtp_mls’s MlsGroup metadata-field methods (metadata_fields,
metadata_values, user_data, update_metadata_field,
update_user_data, …) read and write application and public well-known
components here. The bindings do not expose them yet. Everything is a pure function of one committed dictionary: a
FieldSnapshot lists the fields its registry describes, decodes their
values, and encodes writes. Nothing here consults the network or storage.
MetadataFieldRefnames a field: its component ID plus a label. The well-known constants (MetadataFieldRef::GROUP_NAME, …) cover the public well-known fields. The core resolves a ref by ID only.MetadataFieldDescriptordescribes a listed field: its ref,MetadataComponentType, and committed permissions.FieldValue,FieldKey, andMetadataValuecarry typed values;MetadataFieldValueandUserFieldValuepair them with a ref.ComponentMutationandUserFieldUpdatedescribe writes.FieldSnapshot::field_writeandFieldSnapshot::user_data_writesencode them asFieldWrites, andFieldSnapshot::resolve_writesturns those intoAppDataUpdateoperations against a dictionary.
§Authority
The committed registry is the only authority for a field’s existence and
policy. A well-known field’s type is fixed by the protocol (component_type);
an application field’s type is its registry entry’s tag. The backend
catalogue only supplies the label of an application field and so the name
that FieldSnapshot::field matches. A registry entry that does not
decode is preserved in the dictionary but is not a field.
Structs§
- Field
Snapshot - The metadata fields of one dictionary and their values.
- Field
Write - An encoded write, fixed to the type it was encoded under.
FieldSnapshot::resolve_writesrefuses it if the field’s type changed. - MapEntry
- Metadata
Field Descriptor - A field listed by
FieldSnapshot::fields. - Metadata
Field Ref - Names a metadata field: its component ID and, when one exists, its well-known or backend catalogue name.
- Metadata
Field Value - A field and its value, absent when the group holds none.
- User
Field Update - Set (
Some) or clear (None) the caller’s own entry of a user field. - User
Field Value - One inbox’s value of a user field.
Enums§
- Component
Mutation - A write to one field. Map and set deltas apply atomically: an Insert of a present key, or an Update or Delete of an absent key, rejects the whole commit.
- Field
Error - Field
Key - A map or set key.
- Field
Value - A scalar value or map value.
- MapMutation
- One key-level change to a map field.
- Metadata
Component Type - The shape of a field’s value.
- Metadata
KeyType - The type of a map or set key.
- Metadata
Scalar Type - The type of a scalar field or of a map value.
- Metadata
Value - A decoded field value.
- SetMutation
- One key-level change to a set field.
- Write
Operation