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

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.

Enums§

LinksOperation
One call of the links interface.

Constants§

ANY
The wire spelling of “any value” in a restriction.

Functions§

changes_document
A reply listing changes, one (before) (after) line each.
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.
parse_changes
The (before) (after) pairs of a create, update or delete reply.
parse_count
The count of a (count: N) reply.
parse_link_reply
The link of a set-name or get-by-name reply.
parse_links
The links of an each reply.
parse_name
The name of a get-name reply.

Type Aliases§

Change
A (before, after) change; a missing side is Link::null.
Part
One part of a restriction: None matches any value.