pub struct GitlabAdapter { /* private fields */ }Expand description
GitLab, exposed as an arbor.
Implementations§
Trait Implementations§
Source§impl AstAdapter for GitlabAdapter
impl AstAdapter for GitlabAdapter
Source§fn children_named(&self, node: NodeId, name: &str) -> Vec<NodeId>
fn children_named(&self, node: NodeId, name: &str) -> Vec<NodeId>
Direct addressing, one GET per segment: a group or user at the root, a subgroup or project under a group, an issue/MR by iid (any state), a pipeline by id.
Source§fn traits(&self, node: NodeId) -> Vec<String>
fn traits(&self, node: NodeId) -> Vec<String>
Kinds, visibility, flags, topics, labels (scoped labels included), and pipeline/job statuses, all as traits.
Source§fn property(&self, node: NodeId, name: &str) -> Option<Value>
fn property(&self, node: NodeId, name: &str) -> Option<Value>
Curated scalars per kind; timestamps as instants,
::topics and ::labels as lists.
Source§fn default_value(&self, node: NodeId) -> Option<Value>
fn default_value(&self, node: NodeId) -> Option<Value>
A file’s decoded content; an issue’s, MR’s, or release’s description text.
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>
::parent--> (a fork’s upstream), ::author-->.
Source§fn links(&self, node: NodeId) -> Vec<(String, NodeId)>
fn links(&self, node: NodeId) -> Vec<(String, NodeId)>
member edges (with access-level edge data) from groups
and projects; parent from forks; author / assignee /
reviewer from issues and merge requests.
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>
The member edge carries its access level:
$-::access (the numeric level) and $-::role.
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 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 properties(&self, _node: NodeId) -> Vec<(String, Value)>
fn properties(&self, _node: NodeId) -> Vec<(String, Value)>
The node’s own properties, enumerated — name and value, in
the source’s order — for readings that keep values off the
tree (the JSON property reading, where an object’s scalar
fields are no nodes). The serializers (
| json, | xml,
| kaiv) merge them with the children, a child winning a
shared name. The default is none: for a reading whose values
are all nodes, the children already say everything.Source§fn walks_for_references(&self) -> bool
fn walks_for_references(&self) -> bool
Whether a reverse resolution or a value match with no scope
may walk the whole arbor to find its referrers. An adapter
over a small, in-memory source opens to the walk; a store or
a service does not, and such a query is refused with a message
asking for a scope — an empty answer could not be told from an
absence of referrers. A declared reference (a foreign key, a
model
ref) answers through reverse_resolve
and needs no walk.Source§fn can_refer_to(&self, source: NodeId, _target: NodeId) -> Option<bool>
fn can_refer_to(&self, source: NodeId, _target: NodeId) -> Option<bool>
Whether a reference declared on
source — a catalog key, a
model ref, a reference property the format defines — can
land in target’s container. A question of the schema, never
of the data; None where nothing is declared at the node.
The default: a node with a reference property of its own can
refer anywhere (an href may point at any element).Source§fn reference_properties(&self, source: NodeId, _target: NodeId) -> Vec<String>
fn reference_properties(&self, source: NodeId, _target: NodeId) -> Vec<String>
The reference properties declared on
source that can land
in target’s container: a catalog’s key columns into the
target’s table, the fields of a model’s refs, the node’s
own reference property. What t<-- and t<--(SCOPE) read
when the query names no property; empty where none is
declared.Source§fn resolve_needs_label(&self, _node: NodeId, _property: &str) -> bool
fn resolve_needs_label(&self, _node: NodeId, _property: &str) -> bool
Whether resolving
property of node needs a reference
label, because the property itself declares no target: a
column with no key, or any property of a property graph,
where a value names a node only under a node label. A
label-less ::p--> over such a property is refused with the
remedy, since an empty answer would read as “points nowhere”.Source§fn reverse_label(&self, _target: NodeId) -> Option<String>
fn reverse_label(&self, _target: NodeId) -> Option<String>
The reference label under which a referrer’s property is
also resolved when a reverse arrow asks about
target and
the query writes no label. None (the default): only the
label-less resolution counts. An adapter whose label names a
container (a table, a collection, a node label) returns the
one target stands in, so /authors/1<--(/books/*::author_id)
reads author_id as a key into authors without the query
saying so. The engine derives no label of its own.Source§fn tree_identities(&self) -> Vec<(String, NodeId)>
fn tree_identities(&self) -> Vec<(String, NodeId)>
The trees of this arbor other trees refer to by name: each
identity (a URL, a path, any string a reference may hold)
with the node that stands for the tree. An identity ending
in a separator is a base: every identity beneath it names
the node reached beneath the base’s node by the remainder’s
segments. Declared in a model (
tree IDENTITY: PATH;) and
automatic for a mount’s own target; the engine reads nothing
inside an identity beyond prefix and separator.Source§fn property_names(&self, node: NodeId) -> Vec<String>
fn property_names(&self, node: NodeId) -> Vec<String>
The names of the properties a node has — what “any
property” means for
<--(SCOPE::*). By default its off-tree
properties, its reference property, and its children’s names
(a row’s columns, an object’s keys are properties under the
same names); an adapter whose properties are not children
(an element’s attributes) lists them.Source§fn resolves_references(&self) -> bool
fn resolves_references(&self) -> bool
Whether this source resolves references at all. An adapter
with no notion of a reference (a CSV file, a directory, a
log stream) says no, and a reverse arrow over it is refused
with the value match as the remedy, rather than answered
with an empty set that would read as “nothing points here”.
Source§fn index_lookup(
&self,
_scope: &str,
_property: &str,
_value: &Value,
) -> Option<Vec<NodeId>>
fn index_lookup( &self, _scope: &str, _property: &str, _value: &Value, ) -> Option<Vec<NodeId>>
index SCOPE::prop; — the nodes of the declared scope whose
property holds value, from an index the model keeps; None
when no declaration covers the pair (the walk answers). An
index changes cost, never the answer: the caller still tests
each node it names.Source§fn index_referrers(
&self,
_scope: &str,
_property: &str,
_label: Option<&str>,
_target: NodeId,
) -> Option<Vec<NodeId>>
fn index_referrers( &self, _scope: &str, _property: &str, _label: Option<&str>, _target: NodeId, ) -> Option<Vec<NodeId>>
The declared-scope nodes whose
property resolves (under the
relation label, when given) to target, from the same index;
None when no declaration covers the pair.Source§fn non_tree_nodes(&self) -> Vec<NodeId>
fn non_tree_nodes(&self) -> Vec<NodeId>
The nodes of the arbor that are not in the tree — joined to
it by crosslinks alone, with no parent and no path. The
universal search
*// reaches them after the tree, in this
order; :::is-non-tree is true on them. The default is
none: every shipped adapter puts every node in the tree.Source§fn child_host(&self, node: NodeId) -> NodeId
fn child_host(&self, node: NodeId) -> NodeId
The node whose children an explicit child step from
node
reads. The default is node itself. An adapter whose tree
holds transparent links (a filesystem’s symlink to a
directory) answers the link’s target, so /link/name lands
on the target’s own child — the same node /target/name
reaches. The descendant walk never consults this: it reads
children alone, so a linked subtree is
walked once, under its own parent, and a cycle of links
cannot trap it.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
. 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 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 external_ref(
&self,
_node: NodeId,
_property: &str,
_hint: Option<&str>,
) -> Option<ExternalRef>
fn external_ref( &self, _node: NodeId, _property: &str, _hint: Option<&str>, ) -> Option<ExternalRef>
The external reference
node’s property holds, if any: the
identity of a document outside this arbor and, where the
reference says so, the location within it — both as the
adapter reads them out of its own reference syntax (for html,
the anchor’s absolute URL and its fragment). The engine does
not look inside either string: it asks for the document among
the mounts (the host’s registration, then
document_by_ref), and hands the
location to resolve_fragment on
the document it found. Consulted by ::property--> when
in-document resolution misses; an unmounted document 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 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 descendants_where(
&self,
_node: NodeId,
_name: &str,
_property: &str,
_value: &Value,
) -> Option<Vec<(NodeId, usize)>>
fn descendants_where( &self, _node: NodeId, _name: &str, _property: &str, _value: &Value, ) -> Option<Vec<(NodeId, usize)>>
The descendants of
node named name whose property
property equals value, each with its depth, in document
order — the fast path behind //name[::property = "value"]
for an adapter that indexes a property (the corpus reading’s
positional index answers //token[::lower = "tom"] from it).
None keeps the engine’s walk and its comparison; Some
must be exactly what the walk would find under the standard
equality, so an adapter answers only the values it can
compare as the engine does (text against text).Source§fn select(&self, from: NodeId, plan: &StepPlan<'_>) -> Option<Selection>
fn select(&self, from: NodeId, plan: &StepPlan<'_>) -> Option<Selection>
The search fast path: the nodes one step reaches from
from
under plan, answered from an index — None keeps the
engine’s walk (the default folds children_named,
descendants_named and descendants_where:
select_by_hooks). Some must be exactly what the walk
would find for the conjuncts it marks applied, under the
engine’s standard equality; the engine tests the remaining
conjuncts and every other predicate on the nodes returned. A
child plan’s answer is never re-filtered by name (the adapter
owns the name test, as children_named does); a descendant
plan’s nodes still pass the nameless tests.Source§fn select_plan(
&self,
_scope: &[&str],
_plan: &StepPlan<'_>,
) -> Option<Vec<bool>>
fn select_plan( &self, _scope: &[&str], _plan: &StepPlan<'_>, ) -> Option<Vec<bool>>
The dry-run form of
select: which of the
plan’s conjuncts the adapter would apply, decided from its
catalog alone (a column’s existence and type, an index’s
presence), with no node in hand. scope is the literal path
from the root to the step’s base (["invoices"] for
/invoices/*[...]), empty at the root. None when the
adapter cannot say — the static plan then counts every
conjunct as the engine’s.Source§fn estimate(&self, _scope: &[&str], _plan: &StepPlan<'_>) -> Option<Estimate>
fn estimate(&self, _scope: &[&str], _plan: &StepPlan<'_>) -> Option<Estimate>
What reaching one step’s nodes would cost, said from the
catalog with no node in hand (
scope as for
select_plan): a warehouse’s dry run,
a table’s statistics, a file’s size, an arena’s count.
None where the adapter has no estimator — the plan then
reads “unknown” for the step.Source§fn count(&self, _from: NodeId, _plan: &StepPlan<'_>) -> Option<usize>
fn count(&self, _from: NodeId, _plan: &StepPlan<'_>) -> Option<usize>
How many nodes one step reaches from
from under plan,
without materializing them — @| count right after the step
asks before walking. None walks; Some must be exactly the
walk’s count for the conjuncts the plan carries (every one of
them, or none: a count cannot be partially applied). SQL:
SELECT COUNT(*); a document index: the bucket’s length.Source§fn prefetch_properties(&self, _nodes: &[NodeId], _names: &[&str])
fn prefetch_properties(&self, _nodes: &[NodeId], _names: &[&str])
A batching hint, the projection twin of
prefetch_links: the
engine is about to read the properties names of every node
in nodes (the next command projects them). A remote adapter
fetches the columns for the frontier in one round trip;
semantics are unchanged either way.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 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; a
run may override it (Run::quantifier_bound, the CLI’s
--quantifier-bound). The shell gate and the invocation
instant are the run’s alone (Run::allow_shell, Run::now).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 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 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 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 !Freeze for GitlabAdapter
impl !RefUnwindSafe for GitlabAdapter
impl !Send for GitlabAdapter
impl !Sync for GitlabAdapter
impl Unpin for GitlabAdapter
impl UnsafeUnpin for GitlabAdapter
impl UnwindSafe for GitlabAdapter
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