pub struct Dyn(pub Box<dyn AstAdapter>);Expand description
A boxed adapter as an adapter — plain delegation (the
quarb-py Dyn pattern).
Tuple Fields§
§0: Box<dyn AstAdapter>Trait Implementations§
Source§impl AstAdapter for Dyn
impl AstAdapter for Dyn
Source§fn children(&self, node: NodeId) -> Vec<NodeId>
fn children(&self, node: NodeId) -> Vec<NodeId>
The tree children of
node, in document order. Read moreSource§fn name(&self, node: NodeId) -> Option<String>
fn name(&self, node: NodeId) -> Option<String>
The name of
node — the label of its incoming tree edge. Read moreSource§fn traits(&self, node: NodeId) -> Vec<String>
fn traits(&self, node: NodeId) -> Vec<String>
The traits of
node — its adapter-defined classifications,
used by <trait> navigation filters (e.g. a filesystem
adapter’s <dir>, <code>, <image>).Source§fn property(&self, node: NodeId, name: &str) -> Option<Value>
fn property(&self, node: NodeId, name: &str) -> Option<Value>
A named property of
node — ::prop. None if absent.Source§fn children_named(&self, node: NodeId, name: &str) -> Vec<NodeId>
fn children_named(&self, node: NodeId, name: &str) -> Vec<NodeId>
The children of
node whose edge name is exactly name —
the engine’s fast path for name-matcher child hops. The
default filters children; an adapter
whose containers cannot be enumerated (permission-scoped or
unbounded remote trees) overrides this with a direct,
name-addressed lookup. Must be observationally identical to
the default wherever enumeration works. The adapter owns the
name test: it may deliberately alias — resolve a name to a
node whose edge name differs (git revision syntax landing on
a hash-named commit) — and the engine will not re-filter.
Container-scoped resolution like that stays child-axis only;
per-node spelling aliases belong in
answers_to, which this default
consults.Source§fn default_value(&self, node: NodeId) -> Option<Value>
fn default_value(&self, node: NodeId) -> Option<Value>
The default projection of
node — bare ::, adapter-specific
(a filesystem adapter returns file content).Source§fn metadata(&self, node: NodeId, key: &str) -> Option<Value>
fn metadata(&self, node: NodeId, key: &str) -> Option<Value>
Adapter-defined metadata —
::::key (a filesystem adapter’s
size, modified, permissions, …). None if absent.Source§fn aliased_metadata(&self, node: NodeId) -> &'static [&'static str]
fn aliased_metadata(&self, node: NodeId) -> &'static [&'static str]
Metadata keys this adapter also answers at
:: (ruling
#29), for the given node — per node, because a composite
adapter (a multi-mount, a graft) answers for whichever
document owns it. Only an adapter whose property surface is closed —
fixed by the adapter, never grown by document content — may
declare aliases: a git commit cannot sprout a short field,
where a JSON object can sprout anything. Data always wins:
the engine consults property first and falls through only
when it answers None for that node, so an alias can never
shadow a document. Core metadata (:::) is never aliased —
name, id and index exist on every node, and aliasing
them would change what ::name means wherever a document
happens to lack that field.Source§fn links(&self, node: NodeId) -> Vec<(String, NodeId)>
fn links(&self, node: NodeId) -> Vec<(String, NodeId)>
Outgoing crosslinks from
node, as (label, target) pairs,
for -> navigation (a filesystem adapter’s symlinks).Source§fn backlinks(&self, node: NodeId) -> Vec<(String, NodeId)>
fn backlinks(&self, node: NodeId) -> Vec<(String, NodeId)>
Incoming crosslinks to
node, as (label, source) pairs, for
<- navigation. May be expensive (an adapter that does not
precompute edges must search for referrers).Source§fn resolve(
&self,
node: NodeId,
property: &str,
hint: Option<&str>,
) -> Option<NodeId>
fn resolve( &self, node: NodeId, property: &str, hint: Option<&str>, ) -> Option<NodeId>
Resolve a cross-reference:
::property-->hint maps node’s
property (a value that references another node) to its target,
with an optional adapter-specific hint (a relation type such as
an html rel, or a target container such as a table). A JSON
adapter resolves a $ref JSON Pointer; None if unresolvable.Source§fn external_ref(
&self,
node: NodeId,
property: &str,
hint: Option<&str>,
) -> Option<String>
fn external_ref( &self, node: NodeId, property: &str, hint: Option<&str>, ) -> Option<String>
The external reference
node’s property holds, if any: an
adapter-defined identifier of a document outside this
arbor — for html, the anchor’s absolute URL, a relative
href joined against the document’s own URL. A #fragment
part is the crossref within the target document and rides
along (URI semantics). Consulted by ::property--> when
in-document resolution misses: a mounted document with that
identifier answers (the fragment’s element, else its root),
an unmounted one lands among the run’s unresolved external
references for the host’s acquisition loop. The engine
itself never fetches.Source§fn resolve_fragment(&self, node: NodeId, fragment: &str) -> Option<NodeId>
fn resolve_fragment(&self, node: NodeId, fragment: &str) -> Option<NodeId>
The element
fragment names inside the document node
belongs to — html’s id lookup. The landing rung of a
fragment-carrying external reference, once its document is
mounted.Source§fn ref_property(&self, node: NodeId) -> Option<String>
fn ref_property(&self, node: NodeId) -> Option<String>
The property carrying
node’s own reference, for the bare
arrow (//a-->): an html anchor’s href, an iframe’s
src. None for a node that references nothing.Source§fn ref_label(&self, node: NodeId, property: &str) -> Option<String>
fn ref_label(&self, node: NodeId, property: &str) -> Option<String>
The relation name a resolution edge from
node via
property carries — html’s rel attribute. None falls
back to the property name as the edge label.Source§fn link_property(
&self,
source: NodeId,
label: &str,
target: NodeId,
name: &str,
) -> Option<Value>
fn link_property( &self, source: NodeId, label: &str, target: NodeId, name: &str, ) -> Option<Value>
A property of the crosslink
source --label--> target — the
$-::prop read. Adapters whose edges carry data (a property
graph’s relationship properties) override this; None if the
edge is bare or unknown. Where parallel edges share source,
label, and target, the adapter answers for one of them,
consistently.Source§fn quantifier_bound(&self) -> usize
fn quantifier_bound(&self) -> usize
The quantifier bound N_max: the depth to which open-ended path
quantifiers (
+, *, {m,}) expand, and the ceiling of any
explicit {m,n} (the effective upper bound is min(n, N_max)).
An adapter whose natural structures run deep may raise it; the
CLI overrides it per run (qua --quantifier-bound).Source§fn invocation_instant(&self) -> Option<(i64, u32)>
fn invocation_instant(&self) -> Option<(i64, u32)>
The invocation instant
now() denotes (spec: The Temporal
Fragment, Determinism): one UTC timeline point bound by the
runner BEFORE evaluation begins — evaluation itself never
reads a clock. None by default (a library run is fully
deterministic; now() reads as null); the CLI binds it at
startup — pinnable with qua --now — through the
WithNow wrapper.Source§fn unit_scale(&self, expr: &str) -> Option<(f64, String)>
fn unit_scale(&self, expr: &str) -> Option<(f64, String)>
The scale of a unit expression — (factor, canonical SI-base
expansion) — for the unital reading’s criterion text (spec:
The Quantital Fragment). The default answers from the
engine’s frozen built-in table; a unit-aware adapter (kaiv)
overrides it to include the mounted document’s own custom
units, so
[::range < '50kellicam'] resolves through the
document’s .!units imports.Source§fn answers_to(&self, node: NodeId, name: &str) -> bool
fn answers_to(&self, node: NodeId, name: &str) -> bool
Whether
node answers to name as a literal spelling
(ruling #30). The default is canonical equality. An adapter
may declare per-node aliases — a social feed spelling a
handle @alice while the stripped alice is the hop name —
and the engine consults this wherever a literal name is
matched, on every axis, so one override keeps /@alice and
//@alice in agreement. :::name stays canonical (locators
and reflection print it; an alias is a way in, never a way
out), and name patterns (~(...), *) test the canonical
name only.Source§fn has_trait(&self, node: NodeId, name: &str) -> bool
fn has_trait(&self, node: NodeId, name: &str) -> bool
Whether
node bears name as a trait, as written in a
<...> clause. The default is membership in
traits; an adapter may declare aliases the
way answers_to does for names — a
model file’s alias <chunk> <block>; or
alias <s/^tag://i>; — and the engine consults this
wherever a written trait is matched. Reflection and
serialization print the canonical traits only.Source§fn has_node(&self, node: NodeId) -> bool
fn has_node(&self, node: NodeId) -> bool
Whether
node is an id this adapter minted — the guard
behind the node-id anchor ((!N)), which may name an id
from an earlier run (ids are minted deterministically: the
same source, the same ids). The default probes the id
through parent and name and treats a panic as absence,
so an adapter that indexes by id needs no override; one that
can answer cheaply should.Source§fn document_by_ref(&self, id: &str) -> Option<NodeId>
fn document_by_ref(&self, id: &str) -> Option<NodeId>
The document this arbor holds under an external-reference
identifier (a URL, fragment-stripped), when it can answer
without the host’s registration: the landing rung of
-->
after the mounted-document table misses. An adapter over a
store of pages answers by URL lookup; the engine performs
no IO either way.Source§fn reverse_resolve(
&self,
node: NodeId,
property: Option<&str>,
hint: Option<&str>,
) -> Option<Vec<NodeId>>
fn reverse_resolve( &self, node: NodeId, property: Option<&str>, hint: Option<&str>, ) -> Option<Vec<NodeId>>
Every node whose
property (or, when None, own reference
property) resolves to node, in document order — the
reverse index behind <--. None keeps the engine’s walk
of the whole arbor; Some is the adapter’s complete answer.Source§fn descendants_named(
&self,
node: NodeId,
name: &str,
) -> Option<Vec<(NodeId, usize)>>
fn descendants_named( &self, node: NodeId, name: &str, ) -> Option<Vec<(NodeId, usize)>>
The descendants of
node that answer to name, each with
its depth (children are depth 1), in document order — the
fast path behind //name for an adapter whose substrate
indexes names. None keeps the engine’s walk; Some must
be exactly what the walk would find.Source§fn prefetch_links(&self, nodes: &[NodeId], dir: LinkDir)
fn prefetch_links(&self, nodes: &[NodeId], dir: LinkDir)
A batching hint: the engine is about to follow
dir
crosslinks from every node in nodes. An adapter backed by
a store may fetch them in one statement; semantics are
unchanged either way.Source§fn provenance(&self, node: NodeId) -> Provenance
fn provenance(&self, node: NodeId) -> Provenance
The data provenance of
node — the :::source /
:::instant / :::dpid / :::provenance core-metadata
keys. Empty by default: an adapter answers only the
components its substrate genuinely records (never the
invocation clock); wrapper adapters fill missing components
from what they know — the mount its target, a graft its
outer leaf, a model its derivation — and forward the rest
inward, so resolution is nearest-ancestor per component.Source§fn provenance_list(&self, node: NodeId) -> ProvenanceList
fn provenance_list(&self, node: NodeId) -> ProvenanceList
The data provenance of
node as a list — every source the
substrate records for the datum, and how many it elides.
The default is the singular answer as a one-entry list; an
adapter whose substrate records several (kaiv’s ?a;b;+N)
overrides it, and a wrapper layers each entry.Source§fn allow_shell(&self) -> bool
fn allow_shell(&self) -> bool
Whether the
sh(...) pipeline stage may run external
commands. False by default — query text stays inert data —
and enabled per run by the CLI (qua --allow-shell) through
the AllowShell wrapper.Auto Trait Implementations§
impl !RefUnwindSafe for Dyn
impl !Send for Dyn
impl !Sync for Dyn
impl !UnwindSafe for Dyn
impl Freeze for Dyn
impl Unpin for Dyn
impl UnsafeUnpin for Dyn
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more