Skip to main content

GraphModel

Struct GraphModel 

Source
pub struct GraphModel {
Show 13 fields pub krate: Path, pub vis: Visibility, pub name: Ident, pub nodes: Vec<Type>, pub mounts: Vec<Ident>, pub queried: Vec<Type>, pub interfaces: Vec<InterfaceMount>, pub resources: Vec<ResourceField>, pub fused: Vec<FusedMember>, pub origins: Vec<OriginMount>, pub engines: Vec<EngineBinding>, pub retired: Option<RetiredLedger>, pub generations: Option<GenerationsSeat>,
}
Expand description

A validated ingraph root, ready to emit.

Plain public fields, for the reason every model in this crate has them: the front ends that build one — the derive today, a compiler from a manifest later — reach the same emitter without either of them being this crate’s concern.

Fields§

§krate: Path

Where ingraph lives, as the declaration named it or ::ingraph by default.

§vis: Visibility

The root’s own visibility — what the emitted entries take, so a private ingraph’s walk stays private rather than leaking into its crate’s public API.

§name: Ident

The root type.

§nodes: Vec<Type>

The NODES, in the order the declaration’s fields were written.

§mounts: Vec<Ident>

The field NAMES, in that same order.

The query surface’s mount names, and the wire round is what will spend them as that. What spends them TODAY is mounts: the walk reads a field’s TYPE and never its value, so without one read somewhere every graph root would carry a dead_code warning per node — a lint about a member the framework declared and has not paid for yet.

§queried: Vec<Type>

The nodes whose ROOT FIELDS join the graph’s query, in the order the declaration wrote them — a SUBSET of nodes, read off the #[ingraph(query)] word.

A second list rather than a flag beside each node, because the two are spent by two emissions: the walk visits every node and the fold projects only these. Empty is the ordinary state of a graph that serves no schema, and it is what makes the whole query emission conditional — see query.

§interfaces: Vec<InterfaceMount>

The INTERFACES this root declares, in the order the declaration’s fields were written.

A THIRD list beside the nodes and the resources, and the tier word is what puts a field on it. An interface owns no table, mints no id and has no options section, so it joins none of the three walks a node joins — the storage description, the create pass, the options spine — and a list of its own is what states that rather than three exclusions restating it.

Empty is the ordinary state. What reads it is mounts, for the dead_code reason every mount is read, and query, which projects the ones that wrote the mount word.

§resources: Vec<ResourceField>

The RESOURCES, in the order the declaration’s fields were written.

A separate list from the nodes because the two are spent differently — a node is built from its own section and wired, a resource is built once and handed out — and one namespace because they are one struct’s fields. See crate::catalog.

§fused: Vec<FusedMember>

The RETRIEVING members this root mounts, in the order the declaration wrote them — read off the fuse word.

§A FOURTH TIER, and that is forced rather than chosen

A fused member is a RETRIEVING DECLARATION — a #[ingraph::vector(…)] or #[ingraph::fulltext(…)] one — and those are not launchable nodes: they implement neither Declared nor AsyncConstructor, so a field naming one on the NODE tier is E0277 at the root before anything about fusion is reached. An index owns no Creation::node, has no options section, and nothing about it is the storage-description walk’s.

So fuse is a TIER WORD, exactly as interface and resource are, and it is what keeps a retrieving member off the three walks a node joins. That is now the WHOLE of what it says: the modality trims it used to carry retired with the doors they trimmed.

What the list is SPENT on is the slot walk and the launch — the two places a retrieving member differs from a node — and the destructuring that reads every mount. The FUSED DOORS it used to mint are #[ingraph::search]’s now, one recipe at a time: see crate::search::fuse, which carries the migration note. Empty is the ordinary state of a root that mounts no index.

§THE WORD IS A BARE LAYER NOW, AND IT IS RECORDED RATHER THAN SWEPT

Everything fuse decided has left it: the trims, the typed doors, the packages, the evidence enums and — on 2026-08-19 — the two modality markers the trims used to demand. What is left is this field is on the retrieving tier, which is a fact the INDEX LAYER already knows about itself: a #[ingraph::vector(…)] declaration implements neither Declared nor AsyncConstructor, so the tier is derivable from the type rather than declared beside it.

The word is NOT retired in this round, and the reason is that the successor is not built. Deriving the tier means the root reading a trait bound off each member’s type, which is the index-layer re-expression crate::search is heading toward; retiring the word before that exists would take a working declaration away and give nothing back. So it stays, carrying one bit, and the DEBT is written here rather than left as a shape a reader has to notice:

when the index layer can state its own tier, fuse goes whole — the word, this list, the FusedMember type and the reader in ingraph_derive::graph::resource. Not narrowed, not defaulted: a word that carries one derivable bit is a word with nothing left to say.

§origins: Vec<OriginMount>

The ORIGINS this root mounts, in the order the declaration wrote them — read off the origin word.

§A FIFTH TIER, and it is forced by the same wall the fourth was

An origin is an #[ingraph::source] declaration, and those are not launchable NODES: they implement DeclaredOrigin rather than Declared, so a field naming one on the node tier is E0277 at the root before anything about a feed is reached. An origin owns no table for the storage walk to describe, mints no id, answers no query and declares no upstream — what it has instead is ONE OUT-EDGE, and that edge IS its feed.

So the two walks it joins are the two a node’s own membership is spent on and no others: the OPTIONS SPINE (presence is enablement, exactly as a node’s section is) and the LAUNCH, which declares it as a head, builds it from its section, opens its one edge and puts it on an engine. The storage walk, the slot walk, the resource catalog and the root query each skip it by construction rather than by exclusion — there is nothing about an origin for any of them to read.

Empty is the ordinary state of a root that mounts no origin, and it is what makes every one of this tier’s emissions disappear rather than loop over no members.

§engines: Vec<EngineBinding>

The ENGINE WORDS this root binds, in the order they were written — engines(hnsw = "app::hnsw::Hnsw").

EMPTY is the ordinary state, and it does not mean no engines: a deployment whose declarations name only SHIPPED words binds nothing here, a shipped word self-binding under its own feature. What this list holds is the third-party half — the open vocabulary’s other end.

It is on the ROOT rather than on a declaration for EngineBinding’s reason: a word on a field is a NAME, and a name is bound where the program is assembled.

§retired: Option<RetiredLedger>

The RETIRED LEDGER this root declares, or None where it declared none.

One per root and never a list: a deployment’s retirees live in ONE place, the ledger being the truth about which root keys are out rather than a per-family choice. What varies per family is the TABLE — __ig_retired_<family> — and that is minted at run time off the family’s own name, families being opened rather than declared.

None is the ordinary state, and it is a graph with no durable retirement at all: the registry still runs, a retirement still moves a key’s state, and nothing is written down. See crate::options for the section this grows, and ingraph::drive::retired for what it means at run time.

§generations: Option<GenerationsSeat>

The GENERATIONS SEAT this root declares, or None where it declared none.

retired’s sibling one field over, and one per root for its reason: a deployment’s current pointers live in ONE place, the pointer table being the truth about which generation each closure is reading rather than a per-family choice. What varies per family is the TABLE — __ig_current_<family> — and that is minted at run time off the family’s own name, families being opened rather than declared.

None is the ordinary state, and it is a graph with no generational discipline at all: the registry still closes runs, a run still earns a flip, and nothing is written down. See crate::options for the section this grows, and ingraph::drive::generations for what it means at run time.

Implementations§

Source§

impl GraphModel

Source

pub fn emit(&self) -> TokenStream

The walk, the two entries that drive it, the one line that reads the fields, the resource catalog, and the options spine a deployment configures the root through.

Source

pub fn catalog(&self) -> Catalog<'_>

This root’s RESOURCE CATALOG — see crate::catalog for the block it emits and the walk it declares them through.

A borrow of the same list the other two borrow, for the same reason.

Source

pub fn launch(&self) -> LaunchEntry<'_>

This root’s LAUNCH ENTRY — see crate::launch for the sequence it walks and the three things it has to be handed.

A borrow of the same list options borrows, for the same reason.

Source

pub fn options(&self) -> OptionsSpine<'_>

This root’s OPTIONS SPINE — see crate::options for the whole of what it emits and why.

A borrow of the list this model already holds, rather than a second copy of it.

Trait Implementations§

Source§

impl Clone for GraphModel

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GraphModel

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.