Skip to main content

Module links_operations

Module links_operations 

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

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

LinksNotification
A change a LinksServer pushed to a subscriber: the subscription it fits and its changes, a missing side being Link::null.

Enums§

GenericLinksOperation
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 document is a push rather than a reply: its first link is (notify: N).
link_lino
(index: source target) with plain numbers.
matches
Whether link matches restriction, 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 a create, update or delete reply.
parse_count
The count of 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-name or get-by-name reply.
parse_links
The links of an each reply using the existing u32 facade.
parse_links_for
The links of an each reply.
parse_name
The name of a get-name reply.
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 is GenericLink::null.
LinksOperation
The existing u32 links operation facade.
Part
One part of a restriction: None matches any value.