1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//! LiNo substitution operations over TCP/IP (issue #105).
//!
//! Two interchangeable protocols carry LiNo documents between a client and a
//! server:
//!
//! - [`TextLinoProtocol`]: UTF-8 LiNo text, each message ended by a line
//! holding only `.` (SMTP-style dot-stuffing keeps the framing unambiguous).
//! - [`BinaryLinoProtocol`]: a self-delimiting [`LinksPacket`] made of
//! sections of links that share one reference width (1, 2, 4 or 8 bytes)
//! and one [arity range](ArityRange). By default every link is a doublet
//! and the whole packet uses the narrowest width that fits; the options
//! [external references](BinaryLinoOptions::external_references),
//! [arity](BinaryLinoOptions::arity) (for example `2..3` or `1..`) and
//! [packed widths](BinaryLinoOptions::packed_widths) can be switched on
//! one by one.
//!
//! Both implement [`LinoProtocol`], so a [`LinoConnection`] or a
//! [`LinksClient`] switches protocol by swapping one value. A
//! [`LinksServer`] detects the protocol of every message and answers in kind.
//!
//! A request is a substitution query, so it covers create, read, update and
//! delete; the reply lists the `(before) (after)` changes, exactly like
//! `clink --changes`. The empty request reads the whole store.
//!
//! ```
//! use link_cli::protocol::{format_document, parse_document, BinaryLinoOptions, BinaryLinoProtocol};
//!
//! let document = parse_document("() ((1 1))").unwrap();
//! let binary = BinaryLinoProtocol::with_options(
//! BinaryLinoOptions::default().with_external_references(true),
//! );
//! let bytes = binary.encode(&document).unwrap();
//! assert_eq!(binary.decode(&bytes).unwrap(), document);
//! assert_eq!(format_document(&document), "() ((1 1))");
//! ```
pub use ;
pub use LinksClient;
pub use ;
pub use ;
pub use LinksOperation;
pub use ;
pub use ;
pub use ;
pub use RemoteLinks;
pub use ;