Skip to main content

Module codec

Module codec 

Source
Expand description

Codec layer: every conversion between a LinoValue and the wire.

All Links Notation work is delegated to lino_objects_codec, which produces byte-identical readable output in JavaScript, Python, Rust and C#; this module adapts it and adds the media-type dispatch described in docs/spec/README.md section 2.

Enums§

CodecError
Why a value could not be moved between a representation and a LinoValue.

Functions§

decode
Decode readable or compact Links Notation into a value.
decode_from
Decode a representation of a concrete media type.
decode_single_line
Decode one line of single-line readable Links Notation.
encode
Encode a value as readable, indented Links Notation.
encode_compact_notation
Encode a value as compact, type-tagged Links Notation.
encode_for
Encode a value for a concrete media type.
encode_single_line
Encode a value as single-line readable Links Notation.
from_json
Convert a serde_json::Value into a LinoValue, keeping key order.
to_json
Convert a LinoValue into a serde_json::Value, keeping key order.
to_json_pretty
Encode a value as indented JSON, as JSON.stringify(value, null, 2) does.
to_json_string
Encode a value as JSON.