Expand description
The links interface (ILinks in C#, [doublets::Links] in Rust) as LiNo
documents, so a store behind a LinksServer is used
exactly like a local one through RemoteLinks.
Every request is one top-level link named after the operation and holding exactly one value. The substitution query language ignores that shape (a query needs a restriction and a substitution), so an operation never collides with a query sent to the same server.
| Request | Reply |
|---|---|
(count: (index source target)) | (count: N) |
(each: (index source target)) | one (index: source target) per match |
(create: (source target)) | () ((index: source target)) |
(update: (index source target)) | ((index: s t)) ((index: source target)) per changed link |
(delete: index) | ((index: source target)) () per removed link |
(get-name: link) | (name: 'text'), or nothing |
(set-name: (link 'text')) | (link: N) |
(get-by-name: 'text') | (link: N), or nothing |
(remove-name: link) | nothing |
(subscribe: (index source target)) | (subscription: N); later pushes of (notify: N) and its changes |
(unsubscribe: N) | nothing |
A restriction holds up to three parts, matched like the raw links
interface matches a query: none matches every link, (index) one link,
(index value) links of that index whose source or target is value,
and (index source target) matches part by part. * matches anything.
Every reference in a reply is a number; failures are (error: 'message').
The changes of a create, update or delete are the net change of every
link it touched, the way clink --changes reports a query: a cascading
delete is one ((index: source target)) () per removed link, without the
intermediate steps by which the store behind the server got there, which
differ between the C# and the Rust stores.
A subscription belongs to the connection that made it: once a connection
sent (subscribe: restriction), the server pushes it every later change
another connection makes to a matching link, as (notify: N) followed by
the (before) (after) lines of the change. A side that does not match is
left empty, so a link that leaves the subscription arrives as a deletion.
Structs§
- Links
Notification - A change a
LinksServerpushed to a subscriber: the subscription it fits and its changes, a missing side beingLink::null.
Enums§
- Generic
Links Operation - One call of the links interface.
Constants§
- ANY
- The wire spelling of “any value” in a restriction.
Functions§
- changes_
document - A change document using the existing u32 facade.
- changes_
document_ for - A reply listing
changes, one(before) (after)line each. - is_
notification - Whether
documentis a push rather than a reply: its first link is(notify: N). - link_
lino (index: source target)with plain numbers.- matches
- Whether
linkmatchesrestriction, with the shapes of the raw links interface: see the module documentation. - notification_
document - A push:
(notify: N)followed by one(before) (after)line per change, with plain numbers. - parse_
changes - The changes of a mutation reply using the existing u32 facade.
- parse_
changes_ for - The
(before) (after)pairs of acreate,updateordeletereply. - parse_
count - The
countof a(count: N)reply. - parse_
link_ reply - A named-link reply using the existing u32 facade.
- parse_
link_ reply_ for - The link of a
set-nameorget-by-namereply. - parse_
links - The links of an
eachreply using the existing u32 facade. - parse_
links_ for - The links of an
eachreply. - parse_
name - The name of a
get-namereply. - parse_
notification - The subscription and the changes of a
notification_document. - parse_
subscription - The number of a
(subscription: N)reply. - subscription_
document - The reply to a
LinksOperation::Subscribe:(subscription: N).
Type Aliases§
- Change
- A
(before, after)change; a missing side isGenericLink::null. - Links
Operation - The existing u32 links operation facade.
- Part
- One part of a restriction:
Nonematches any value.