const KIND_DICT
pub const KIND_DICT = 0Purpose
Constant KIND_DICT, defining protocol or algorithm parameters.
#encoding/xunTyped block lists inherit their scalar type, validate each element and preserve container/element tags when serialized. Safe homogeneous non-string scalar lists can use compact output; string lists retain block output. Serialization spelling may change: update text snapshots or compare parsed trees when spelling is not contractual. Legacy nonempty !s[...] scalar input remains accepted.
Collection nesting below the root is bounded by MAX_DEPTH (64), including inline, empty and typed containers. Duration validation rejects malformed or unitless input and always advances. Multiline parsing checks structural indentation separately from payload whitespace.
const KIND_DICTpub const KIND_DICT = 0Constant KIND_DICT, defining protocol or algorithm parameters.
const KIND_LISTpub const KIND_LIST = 1Constant KIND_LIST, defining protocol or algorithm parameters.
const KIND_SCALARpub const KIND_SCALAR = 2Constant KIND_SCALAR, defining protocol or algorithm parameters.
const MAX_BYTESpub const MAX_BYTES = 1048576Constant MAX_BYTES, defining protocol or algorithm parameters.
const MAX_DEPTHpub const MAX_DEPTH = 64Constant MAX_DEPTH, defining protocol or algorithm parameters.
struct Spanpub struct Span {
pub lo int
pub hi int
}Structure encapsulating lo, hi.
lo inthi intstruct Docpub struct Doc {
pub kinds []int
pub tag_lo []int
pub tag_hi []int
pub text_lo []int
pub text_hi []int
pub key_lo []int
pub key_hi []int
pub key_hashes []int
pub firsts []int
pub nexts []int
pub lasts []int
pub buf string
pub root_idx int
pub err string
pub line int
pub line_starts []int
pub line_ends []int
pub i int
pub tok_kind int
pub tok_no int
pub tok_klo int
pub tok_khi int
pub tok_khash int
pub tok_vlo int
pub tok_vhi int
}Structure encapsulating kinds, tag_lo, tag_hi, text_lo, text_hi.
kinds []inttag_lo []inttag_hi []inttext_lo []inttext_hi []intkey_lo []intkey_hi []intkey_hashes []intfirsts []intnexts []intlasts []intbuf stringroot_idx interr stringline intline_starts []intline_ends []inti inttok_kind inttok_no inttok_klo inttok_khi inttok_khash inttok_vlo inttok_vhi intnew_docpub fn new_doc() DocConstruct doc.
No arguments are required.
Doc — a value of this type
(Doc) okpub fn (d Doc) ok() boolExecute ok on Doc.
d DocDoc instance used by this call (value receiver).bool — true or false
(Doc) errorpub fn (d Doc) error() stringExecute error on Doc.
d DocDoc instance used by this call (value receiver).string — result string
(Doc) error_linepub fn (d Doc) error_line() intOperation on Doc: error line.
d DocDoc instance used by this call (value receiver).int — a value of this type
(Doc) rootpub fn (d Doc) root() intExecute root on Doc.
d DocDoc instance used by this call (value receiver).int — a value of this type
(Doc) kindpub fn (d Doc) kind(n int) intExecute kind on Doc.
d DocDoc instance used by this call (value receiver).n intint — a value of this type
(Doc) is_dictpub fn (d Doc) is_dict(n int) boolOperation on Doc: whether it is dict.
d DocDoc instance used by this call (value receiver).n intbool — true or false
(Doc) is_listpub fn (d Doc) is_list(n int) boolOperation on Doc: whether it is list.
d DocDoc instance used by this call (value receiver).n intbool — true or false
(Doc) is_scalarpub fn (d Doc) is_scalar(n int) boolOperation on Doc: whether it is scalar.
d DocDoc instance used by this call (value receiver).n intbool — true or false
(Doc) tagpub fn (d Doc) tag(n int) stringExecute tag on Doc.
d DocDoc instance used by this call (value receiver).n intstring — result string
(Doc) textpub fn (d Doc) text(n int) stringOperation on Doc: return the current text.
d DocDoc instance used by this call (value receiver).n intstring — result string
(Doc) keypub fn (d Doc) key(n int) stringExecute key on Doc.
d DocDoc instance used by this call (value receiver).n intstring — result string
(Doc) countpub fn (d Doc) count(n int) intOperation on Doc: count non-overlapping occurrences.
d DocDoc instance used by this call (value receiver).n intint — a value of this type
(Doc) atpub fn (d Doc) at(n int, i int) intExecute at on Doc.
d DocDoc instance used by this call (value receiver).n inti intint — a value of this type
(Doc) getpub fn (d Doc) get(n int, key string) intExecute get on Doc.
d DocDoc instance used by this call (value receiver).n intkey stringint — a value of this type
(Doc) as_strpub fn (d Doc) as_str(n int) stringOperation on Doc: as str.
d DocDoc instance used by this call (value receiver).n intstring — result string
(Doc) as_intpub fn (d Doc) as_int(n int) intOperation on Doc: as int.
d DocDoc instance used by this call (value receiver).n intint — a value of this type
(Doc) as_f64pub fn (d Doc) as_f64(n int) f64Operation on Doc: as f64.
d DocDoc instance used by this call (value receiver).n intf64 — a value of this type
(Doc) as_boolpub fn (d Doc) as_bool(n int) boolOperation on Doc: as bool.
d DocDoc instance used by this call (value receiver).n intbool — true or false
($&Doc) set_rootpub fn (d $&Doc) set_root(r int)Operation on $&Doc: set root.
d $&DocDoc instance used by this call (exclusive borrow).r intThis call does not return a value.
($&Doc) new_nodepub fn (d $&Doc) new_node(kind int, tag string, text string, key string) intOperation on $&Doc: construct node.
d $&DocDoc instance used by this call (exclusive borrow).kind inttag stringtext stringkey stringint — a value of this type
($&Doc) attachpub fn (d $&Doc) attach(parent int, child int)Execute attach on $&Doc.
d $&DocDoc instance used by this call (exclusive borrow).parent intchild intThis call does not return a value.
($&Doc) add_dictpub fn (d $&Doc) add_dict(parent int, key string) intOperation on $&Doc: add dict.
d $&DocDoc instance used by this call (exclusive borrow).parent intkey stringint — a value of this type
($&Doc) add_listpub fn (d $&Doc) add_list(parent int, key string) intOperation on $&Doc: add list.
d $&DocDoc instance used by this call (exclusive borrow).parent intkey stringint — a value of this type
($&Doc) add_scalarpub fn (d $&Doc) add_scalar(parent int, key string, tag string, text string) intOperation on $&Doc: add scalar.
d $&DocDoc instance used by this call (exclusive borrow).parent intkey stringtag stringtext stringint — a value of this type
($&Doc) add_strpub fn (d $&Doc) add_str(parent int, key string, val string) intOperation on $&Doc: add str.
d $&DocDoc instance used by this call (exclusive borrow).parent intkey stringval stringint — a value of this type
($&Doc) add_intpub fn (d $&Doc) add_int(parent int, key string, val int) intOperation on $&Doc: add int.
d $&DocDoc instance used by this call (exclusive borrow).parent intkey stringval intint — a value of this type
($&Doc) add_f64pub fn (d $&Doc) add_f64(parent int, key string, val f64) intOperation on $&Doc: add f64.
d $&DocDoc instance used by this call (exclusive borrow).parent intkey stringval f64int — a value of this type
($&Doc) add_boolpub fn (d $&Doc) add_bool(parent int, key string, val bool) intOperation on $&Doc: add bool.
d $&DocDoc instance used by this call (exclusive borrow).parent intkey stringval boolint — a value of this type
($&Doc) push_dictpub fn (d $&Doc) push_dict(parent int) intOperation on $&Doc: push dict.
d $&DocDoc instance used by this call (exclusive borrow).parent intint — a value of this type
($&Doc) push_listpub fn (d $&Doc) push_list(parent int) intOperation on $&Doc: push list.
d $&DocDoc instance used by this call (exclusive borrow).parent intint — a value of this type
($&Doc) push_scalarpub fn (d $&Doc) push_scalar(parent int, tag string, text string) intOperation on $&Doc: push scalar.
d $&DocDoc instance used by this call (exclusive borrow).parent inttag stringtext stringint — a value of this type
($&Doc) push_strpub fn (d $&Doc) push_str(parent int, val string) intOperation on $&Doc: push str.
d $&DocDoc instance used by this call (exclusive borrow).parent intval stringint — a value of this type
($&Doc) push_intpub fn (d $&Doc) push_int(parent int, val int) intOperation on $&Doc: push int.
d $&DocDoc instance used by this call (exclusive borrow).parent intval intint — a value of this type
($&Doc) push_f64pub fn (d $&Doc) push_f64(parent int, val f64) intOperation on $&Doc: push f64.
d $&DocDoc instance used by this call (exclusive borrow).parent intval f64int — a value of this type
($&Doc) push_boolpub fn (d $&Doc) push_bool(parent int, val bool) intOperation on $&Doc: push bool.
d $&DocDoc instance used by this call (exclusive borrow).parent intval boolint — a value of this type
parsepub fn parse(src &string) DocParse the input.
src &stringDoc — a value of this type
decodepub fn decode(src &string) DocDecode data from encoded representation.
src &stringDoc — a value of this type
encodepub fn encode(d &Doc) stringEncode data into output format.
d &Docstring — result string
(Doc) to_xunpub fn (d Doc) to_xun() stringOperation on Doc: convert to xun.
d DocDoc instance used by this call (value receiver).string — result string