Expand description
The triplets of a server in triplet mode (issue #152) as LiNo documents, so
a store behind a LinksServer is used exactly like a
local Triplets store through RemoteLinks.
(delete: i), (count: ()) and a substitution query read the same in both
worlds, so the shape of a request cannot tell a triplet from a doublet.
That is why triplets are a mode of the server,
ServerOptions::triplets (clink --serve --triplets): a server without it answers exactly as it always did, and one
with it reads every request as triplets.
| Request | Reply |
|---|---|
(count: (index type from to)) | (count: N) |
(each: (index type from to)) | one (index: type from to) per match |
(create: (type from to)) | () ((index: type from to)) |
(create: (0 0 0)) | () ((index: index 0 0)), a point: a triplet that is its own type |
(update: (index type from to)) | ((index: t f t)) ((index: type from to)) |
(delete: index) | ((index: type from to)) () per removed triplet, index first |
(subscribe: (index type from to)) | (subscription: N); later pushes of (notify: N) and its changes |
get-name, set-name, get-by-name, remove-name, unsubscribe and
auth are the same as without triplets, and the
empty request lists every triplet. Any other document is a substitution
query over triplets (process_triplets_query); its reply names the
references that have a name, like a query over doublets.
A restriction holds up to four parts, matched part by part: the parts it
leaves out match anything, as does *; an empty from or to is 0.
The wrappers and pairs that store a triplet in doublets never appear.
A reply or push in a binary format whose arity holds three references but
not the five of (index: type from to), such as 2..3, carries every
triplet as (index: (type from to)), which travels as one link of three
references; see pack_triplets. Every parser here reads both forms.
Structs§
- Triplets
Notification - A change a
LinksServerin triplet mode pushed to a subscriber; a side that does not fit the restriction (or that the subscriber may not read) isNone.
Enums§
- Triplets
Operation - One call of the
Tripletsinterface.
Functions§
- canonical_
triplets - The inverse of
pack_triplets: the canonical text of a triplet reply does not depend on the format that carried it. - execute_
triplets_ request - Answers one request of a server in triplet mode against
triplets; failures produce anerror_document. - matches_
triplet - Whether
tripletmatchesrestriction, part by part. - pack_
triplets - Rewrites every triplet of
documentso it fitsformat: in a binary format whose arity holds three references but not five,(index: type from to)becomes(index: (type from to)), whose second part travels as one link of three references. Under any other format the document stays as it is. - parse_
triplet - A triplet, as
(index: type from to)or aspack_tripletswrites it. - parse_
triplet_ changes - The
(before) (after)pairs of acreate,updateordeletereply. - parse_
triplet_ notification - The subscription and the changes of a
triplet_notification_document. - parse_
triplets - The triplets of an
eachreply. - restriction_
of_ query - The restriction of
query, in the order of the wire. - triplet_
changes_ document - A reply listing
changes, one(before) (after)line each. - triplet_
lino (index: type from to)with plain numbers.- triplet_
notification_ document - A push:
(notify: N)followed by one(before) (after)line per change. - triplet_
query - The query a restriction asks for; the parts it leaves out match anything.