Expand description
Adapter composition: descend through a leaf into its content.
A filesystem’s .json file, an archive’s config.xml entry, a
message’s HTML part — trees of files are full of leaves whose
content is itself a tree in another notation. Composition
grafts that inner tree onto the outer one: wrap any adapter in
a ComposeAdapter and a leaf whose name or content says
“parse me” gains the parsed arbor as its children:
/data/store.json/books/*[/price:: < 12]/title::
└ outer (fs) ┘└──── inner (json) ────┘The graft happens on first touch, lazily: a leaf is only read
and parsed when navigation actually enters it. Detection is by
extension (.json, .xml, .html/.htm/.xhtml/.svg,
.csv/.tsv), else by sniffing the content’s first
character; a parse failure simply leaves the leaf a leaf.
Archive leaves (.zip, .tar, .tar.gz) are binary, so they
graft by path rather than content — available when the outer
substrate has real paths (see
ComposeAdapter::with_source_paths) — and the grafted
archive composes in turn, so one path runs filesystem → tar →
JSON without a seam. The
inner root is identified with the outer leaf node — the leaf
itself answers the inner root’s children — so there is no
phantom node between the file and its content.
Locators show the boundary with a bang, jar-URL style:
store.json!/books/1.
Structs§
Enums§
- Document
Graft - The level marked-up documents (
.html,.htm,.md) graft at: their DOM by default, or the text level — sections, paragraphs, lists, and what the page declares about itself in its head — when the mount asks for the reader’s model (text:on an archive or directory). - Source
Graft - The level source-file leaves graft at: the syntax level (the
literal parse — the default) or the code level (identifiers
as names). Chosen per mount by the
code:target prefix, and inherited by nested composes (an archive inside acode:mount grafts its source entries at the code level too) — the filesystem-into-declarations namespace has no seam.
Constants§
- NOTATIONS
- The notations a leaf can be declared to carry (spec: Grafting):
the one vocabulary
?format=NOTATIONon a mount and<NOTATION>on a step share, the Quarb Readings’ names of the formats. Source languages come besides, by their grammar names. - READINGS
- The readings a graft operand may name as a prefix
(
graft(text:markdown)), as the mount prefixes spell them.
Functions§
- archive_
member_ bytes - The bytes of an archive’s member: the hook an archive mount and
every archive grafted inside another hand to
ComposeAdapter::with_source_bytes. - canonical_
notation - A notation’s canonical spelling: the extension synonyms read as
their notation (
ymlyaml,mdmarkdown,ndjsonjsonl,txttext). - declared_
encoding - The declaration reporter a host hands the source boundary: by the source’s name, the XML prologue for XML-family names, the HTML prescan for HTML names, both tried (prologue first) for a name that says nothing — a plain text file declares nothing either way.
- is_
notation - Whether a word names a notation (
?format=,<NOTATION>). - notation_
of_ name - The canonical notation a name declares by its extension (
.json,.yml,.htm,.ndjson), a source language by its grammar’s extension; None for no extension or one no reader takes. - read_
source - Read one file at the source boundary under the host rule:
?encoding=, then a byte-order mark, then what the file declares, then strict UTF-8. - self_
declared - The notation a text declares about itself in its first bytes (the Quarb Readings’ declared identity): an XML declaration or a DOCTYPE. Nothing else counts; a brace or a bracket is a guess, not a declaration.
- source_
decoding - The rule a host mount carries:
?encoding=validated at open, the reporter above.
Type Aliases§
- Document
Nodes - A host’s reader for a document leaf that has no path: the outer
adapter and the leaf in, its text-level model out (a row’s body
under
?doc=, a model file’sdocumentmember), orNoneto leave the leaf to the default grafting (spec: The Corpus Reading). - Document
Reader - Any adapter, with parseable leaf content grafted as subtrees.
A host’s reader for a document leaf: the path in, its text-level
model out, or
Noneto leave the leaf to the default grafting. - String
Reader - A host’s reading of a lone string (spec: Grafting,
graft(READING:NOTATION)): the reading’s name (text,corpus,lit,koine), the notation the string is to be read as, and the string in; its text-level model out,Some(Err)the reading’s own refusal,Nonewhere the host has no such reading.