Skip to main content

Module triplets_operations

Module triplets_operations 

Source
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.

RequestReply
(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§

TripletsNotification
A change a LinksServer in triplet mode pushed to a subscriber; a side that does not fit the restriction (or that the subscriber may not read) is None.

Enums§

TripletsOperation
One call of the Triplets interface.

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 an error_document.
matches_triplet
Whether triplet matches restriction, part by part.
pack_triplets
Rewrites every triplet of document so it fits format: 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 as pack_triplets writes it.
parse_triplet_changes
The (before) (after) pairs of a create, update or delete reply.
parse_triplet_notification
The subscription and the changes of a triplet_notification_document.
parse_triplets
The triplets of an each reply.
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.