Skip to main content

Module binary

Module binary 

Source
Expand description

Binary links notation version 1: packets and the marker-point LiNo mapping.

Wire specification and shared vectors live in docs/protocol/ in the repository. This module supplies codecs; transports supply their own framing.

use links_notation::binary::{parse_document, BinaryLinoCodec};
let document = parse_document("() ((1 1))")?;
let codec = BinaryLinoCodec::new();
let bytes = codec.encode(&document)?;
assert_eq!(codec.decode(&bytes)?, document);

Re-exports§

pub use packet::ArityRange;
pub use packet::DecodeLimits;
pub use packet::LinksPacket;
pub use packet::Reference;
pub use packet::Section;

Modules§

packet
Binary links notation: a self-delimiting packet of links.

Structs§

BinaryLinoCodec
Convenience codec for complete LiNo packets.
BinaryLinoOptions
Optional features of the binary LiNo protocol.

Enums§

BinaryError
A failure while encoding or decoding a packet or LiNo document.

Functions§

canonical
Converts a parsed link into the canonical model: an unnamed group holding exactly one reference is that reference, so a and (a) both parse as the reference a. links-notation (since 0.17) and its C# port keep that wrapper; removing it gives both ports the same document model.
decode_document
Converts a packet back into a document.
encode_document
Converts a document into a packet.
encode_document_with_limits
Converts a native model into a packet using caller-selected work budgets.
format_document
Formats a document as canonical LiNo text, one top-level link per line.
format_link
Formats one link as it appears nested inside another link.
format_reference
Quotes a reference when it would not survive parsing as a bare word.
parse_document
Parses LiNo text into a canonical document. Blank input is the empty document.

Type Aliases§

BinaryResult
Result returned by the binary codecs.
LinoDocument
A LiNo document: the list of top-level links of a message.