pub struct Borrowed<'a>(pub &'a dyn AstAdapter);Expand description
A borrowing adapter: lets a ModelAdapter enrich an adapter a
caller holds by reference (behind dyn) without taking
ownership — the shape both qua’s run funnel and quai’s
per-query dispatch need, since the concrete adapter is already
wrapped (now-binding, shell-gating) and only borrowed there.
Tuple Fields§
§0: &'a dyn AstAdapterTrait Implementations§
Source§impl AstAdapter for Borrowed<'_>
impl AstAdapter for Borrowed<'_>
Source§fn children(&self, n: NodeId) -> Vec<NodeId>
fn children(&self, n: NodeId) -> Vec<NodeId>
The tree children of
node, in document order. Read moreSource§fn name(&self, n: NodeId) -> Option<String>
fn name(&self, n: NodeId) -> Option<String>
The name of
node — the label of its incoming tree edge. Read moreSource§fn traits(&self, n: NodeId) -> Vec<String>
fn traits(&self, n: 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 children_named(&self, n: NodeId, name: &str) -> Vec<NodeId>
fn children_named(&self, n: 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.Source§fn property(&self, n: NodeId, name: &str) -> Option<Value>
fn property(&self, n: NodeId, name: &str) -> Option<Value>
A named property of
node — ::prop. None if absent.Source§fn default_value(&self, n: NodeId) -> Option<Value>
fn default_value(&self, n: NodeId) -> Option<Value>
The default projection of
node — bare ::, adapter-specific
(a filesystem adapter returns file content).Source§fn metadata(&self, n: NodeId, key: &str) -> Option<Value>
fn metadata(&self, n: NodeId, key: &str) -> Option<Value>
Adapter-defined metadata —
;;;key (a filesystem adapter’s
size, modified, permissions, …). None if absent.Source§fn links(&self, n: NodeId) -> Vec<(String, NodeId)>
fn links(&self, n: NodeId) -> Vec<(String, NodeId)>
Outgoing crosslinks from
node, as (label, target) pairs,
for -> navigation (a filesystem adapter’s symlinks).Source§fn backlinks(&self, n: NodeId) -> Vec<(String, NodeId)>
fn backlinks(&self, n: 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, n: NodeId, p: &str, h: Option<&str>) -> Option<NodeId>
fn resolve(&self, n: NodeId, p: &str, h: 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 relation hint. A JSON
adapter resolves a $ref JSON Pointer; None if unresolvable.Source§fn link_property(
&self,
s: NodeId,
l: &str,
t: NodeId,
name: &str,
) -> Option<Value>
fn link_property( &self, s: NodeId, l: &str, t: 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 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.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.Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Borrowed<'a>
impl<'a> !Send for Borrowed<'a>
impl<'a> !Sync for Borrowed<'a>
impl<'a> !UnwindSafe for Borrowed<'a>
impl<'a> Freeze for Borrowed<'a>
impl<'a> Unpin for Borrowed<'a>
impl<'a> UnsafeUnpin for Borrowed<'a>
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