Expand description
Generic atproto “list” + “listitem” record shapes, shared by every
list-style lexicon in this crate (ai.hyprstream.placement.group/
groupItem, ai.hyprstream.event.group/groupItem, and any future one).
Mirrors app.bsky.graph.list/listitem: a list record names a group
(name/ownerDid/purpose?/createdAt); a listitem record (in the
owner’s repo) claims a member of it (group/subject/createdAt). Two
independently-signed-off lexicons (ai.hyprstream.placement.* and
ai.hyprstream.event.*) need this exact shape but are NOT the same record
type — placement membership (who can be scheduled together) and event-group
membership (who shares a broadcast key) are distinct axes that happen to
share identical list/listitem mechanics. Keeping them as separate NSIDs
preserves cheap collection-based firehose/AppView filtering and avoids
reopening either lexicon’s frozen sign-off; this module is where the
mechanics they share live, so neither duplicates it by hand.
ListItemRecord is used directly (group/subject/createdAt is identical
across every list lexicon so far — no per-lexicon fields needed).
ListRecord<E> is generic over E: ListExtra, the lexicon-specific extra
fields beyond the common name/ownerDid/purpose/createdAt shape
(() for no extra fields; a lexicon-specific payload otherwise).
Structs§
- List
Item Record - An atproto listitem record:
{ group: at-uri, subject: did, createdAt: datetime }. The owner’s claim thatsubjectbelongs togroup; bidirectional consent (the subject’s own record separately consenting) is a fact about the wider system, not this record — seecheck_bidirectional_consent. - List
Record - An atproto list record:
{ name, ownerDid, purpose?, createdAt }plus lexicon-specific extra fieldsE. Mirrorsapp.bsky.graph.list.
Traits§
- List
Extra - A list record’s lexicon-specific extra fields beyond the common
name/ownerDid/purpose/createdAtshape (e.g.keysetIdfor event groups; none —()— for placement groups).
Functions§
- check_
bidirectional_ consent - Generic bidirectional-consent check: the owner’s claim (a fetched
ListItemRecord) namessubjectas a member ofgroup_uriAND the member’s own consent set (an already-resolved list of group at-uris from whatever member-side lexicon — caller’s responsibility) includesgroup_uri. - map_
get_ opt_ str - Read an optional string field. Returns
Nonewhen the field is omitted; an error if it is present but not a text string. - map_
get_ str - Read a required string field, attributing errors to
nsid. - validate_
at_ uri format: "at-uri"— must start withat://and carry a non-empty, whitespace-free authority. (DID grammar is enforced by the resolver.)- validate_
datetime format: "datetime"— atproto ISO-8601 UTC, millisecond precision,Z.- validate_
did - A DID string — must start with
did:and carry a non-empty, whitespace-free method-specific identifier. Bothdid:web:…anddid:key:…are accepted. - validate_
nonempty - A required free-form string that must not be empty (
fieldnames it for the error message).