Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

🕸️graph

Struct Vertex

A named node in the DAG, identified by its ASCII name.

Fields

name: std::ascii::String

Struct EntryGroup

DAGs can group several [Vertex]s into a single entry point.

Fields

name: std::ascii::String

Struct OutputVariant

Names one mutually exclusive output variant of a Tool evaluation, such as ok or err. Together with [OutputPort], variants model an algebraic sum whose selected case carries named fields.

Fields

name: std::ascii::String

Struct OutputPort

Names one payload port within an output variant. This models algebraic enumeration type of first degree.

Example

Let's model computation that can fail, or it can succeed with some image data and some JSON metadata.

There would be a [Vertex] which with two [OutputVariant]s: "ok" and "err". The "err" [OutputVariant] has one [OutputPort]: "reason". The "ok" [OutputVariant] has two [OutputPort]s: "img" and "metadata".

Fields

name: std::ascii::String

Struct InputPort

An input port is a named input to a vertex.

Fields

name: std::ascii::String

Struct VertexEvaluations

Runtime input data collected for a vertex evaluation.

Fields

id: sui::object::UID

Struct VertexEvaluationsInnerV1

Version one stored layout for [VertexEvaluations].

The stable [VertexEvaluations] cannot contain this map because its published layout must remain unchanged while stored data evolves.

Fields

Struct VertexInfo

Describes a vertex and its one explicit offchain verifier selection.

Fields

kind: nexus_interface::graph::VertexKindinput_ports: sui::vec_set::VecSet<nexus_interface::graph::InputPort>Input ports that must be evaluated by tools before this vertex can run.post_failure_action: std::option::Option<nexus_interface::graph::PostFailureAction>Vertex-level post failure action override.tool_id: sui::object::IDStable Tool object ID, bound while constructing the DAG.meta_schema: std::option::Option<nexus_interface::meta_schema::MetaSchema>Immutable Tool schema. None exists only before registry binding.verifier_mode: nexus_interface::verifier::ToolVerifierModeOffchain verification mode; ignored for onchain vertices.

Struct OutputVariantPort

A union of [OutputVariant], and [OutputPort] identifies an output port of a [Vertex].

Fields

Struct VertexInputPort

A union of [Vertex] and [InputPort] uniquely identifies an input port within a DAG graph.

Fields

Struct Edge

Maps output from a unique output port to an input of another vertex.

Fields

Enum RuntimeVertex

Identifies a DAG vertex at runtime, with optional loop iteration state. Iterator state is attached at runtime because the static DAG stores each vertex once.

Variants

Variant WithIteratorvertex: nexus_interface::graph::Vertexiteration: u64Zero-based iteration currently being evaluated.out_of: u64Total number of iterations in this runtime expansion.Variant Plainvertex: nexus_interface::graph::Vertex

Enum VertexKind

Distinguishes whether a vertex is executed on-chain or off-chain.

Variants

Variant OnChainExecutes through the on-chain Tool result flow, whose UID proof requirements bind participation.tool_fqn: std::ascii::StringVariant OffChainDelegates execution to an off-chain Tool and receives its result in a later transaction.tool_fqn: std::ascii::String

Enum PostFailureAction

Action applied when a vertex resolves to failure evidence with no matching outgoing edge. Terminate aborts the execution; TransientContinue lets unrelated walks continue.

Variants

Variant TerminateVariant TransientContinue

Enum EdgeKind

Defines how data moves across an edge, including loop and collection semantics.

Variants

Variant NormalVariant ForEachCan loop over each element in [nexus_primitives::data::NexusData::Many].Variant CollectCan collect multiple elements of the same type into a single [nexus_primitives::data::NexusData::Many].Variant DoWhileCan create a pseudo-loop in the DAG.Variant BreakExits a do-while loop.Variant StaticStatic edges provide values to looped vertices from outside the loop.

Enum PortData

Runtime input data for a single input port, either a single value or one keyed per loop iteration.

Variants

Variant Singledata: nexus_primitives::data::NexusDatais_static: boolVariant Manydata: sui::vec_map::VecMap<u64, nexus_primitives::data::NexusData>total_iterations: u64

Constants

Function vertex_on_chain

Creates an on-chain vertex kind for the given tool fully-qualified name.

Function vertex_off_chain

Creates an off-chain vertex kind for the given tool fully-qualified name.

Function vertex_from_string

Creates a vertex from its ASCII name.

Function vertex_into_string

Returns the vertex's ASCII name.

Function runtime_vertex_plain_from_vertex

Creates a plain runtime vertex (without iterator state) from a vertex.

Function runtime_vertex_plain_from_string

Creates a plain runtime vertex (without iterator state) from an ASCII name.

Function runtime_vertex_with_iterator_from_vertex

Creates a runtime vertex carrying iterator position and bound from a vertex.

Function runtime_vertex_with_iterator_from_string

Creates a runtime vertex carrying iterator position and bound from an ASCII name.

Function edge_kind_normal

Returns the Normal edge kind.

Function edge_kind_for_each

Returns the ForEach edge kind.

Function edge_kind_collect

Returns the Collect edge kind.

Function edge_kind_do_while

Returns the DoWhile edge kind.

Function edge_kind_break

Returns the Break edge kind.

Function edge_kind_static

Returns the Static edge kind.

Function post_failure_action_terminate

Returns the Terminate post-failure action value.

Function post_failure_action_transient_continue

Returns the TransientContinue post-failure action value.

Function output_variant_from_string

Creates an output variant from its ASCII name.

Function output_variant_into_string

Returns the output variant's ASCII name.

Function output_port_from_string

Creates an output port from its ASCII name.

Function output_port_from_raw

Builds the port from raw.

Function output_port_into_string

Returns the output port's ASCII name.

Function input_port_from_string

Creates an input port from its ASCII name.

Function input_port_into_string

Returns the input port's ASCII name.

Function port_data_single

Creates single-valued, non-static port data.

Function port_data_single_static

Creates single-valued port data marked as originating from a static edge.

Function port_data_many

Creates port data keyed by iteration number for a looped vertex.

Function new_vertex_evaluations

Creates an empty VertexEvaluations object with a fresh UID.

Function vertex_evaluations_ports_to_data

Returns a reference to the map from input port to its collected port data.

Function vertex_evaluations_ports_to_data_mut

Returns a mutable reference to the map from input port to its port data.

Function port_data_runtime_vertex_input

Returns the port data value applicable to the given runtime vertex. For single data the value is always returned; for iteration-keyed data the value for the vertex's current iteration is returned, or none if the vertex has no iterator or no value is stored for that iteration.

Function port_data_is_single

Returns true if the port data is a single value rather than iteration-keyed.

Function port_data_single_matches

Returns true if this is single port data whose value and static flag both equal the given arguments.

Function port_data_single_is_static

Returns true if this is single port data that came from a static edge.

Function port_data_many_keys

Returns the iteration keys for iteration-keyed port data, or none if single.

Function port_data_many_total_iterations

Returns the total iteration count for iteration-keyed port data, or none if single.

Function port_data_many_len

Returns the number of stored iteration entries, or none if single port data.

Function port_data_many_contains

Returns true if iteration-keyed port data holds a value for the given iteration.

Function port_data_many_value

Returns the value stored for the given iteration, or none if single port data or no value exists for that iteration.

Function port_data_many_insert

Inserts a value for the given iteration into iteration-keyed port data, returning true on success, or false if this is single port data.

Function port_data_many_remove

Removes and returns the value for the given iteration, or none if single port data or no value exists for that iteration.

Function default_entry_group

Returns the entry group.

Function entry_group_from_string

Creates an entry group from its ASCII name.

Function entry_group_into_string

Returns the entry group's ASCII name.

Function runtime_vertex_is_plain

Returns true if the runtime vertex is plain (has no iterator state).

Function runtime_vertex_is_with_iterator

Returns true if the runtime vertex carries iterator state.

Function runtime_vertex_iteration_or_zero

Returns the current iteration of the runtime vertex, or zero if plain.

Function runtime_vertex_iteration

Returns the current iteration of the runtime vertex. Aborts with ERuntimeVertexIterationUnavailable if the vertex is plain.

Function runtime_vertex_out_of

Returns the total iteration bound of the runtime vertex. Aborts with ERuntimeVertexOutOfUnavailable if the vertex is plain.

Function vertex_kind_is_on_chain

Returns true if the vertex kind is on-chain.

Function vertex_kind_is_off_chain

Returns true if the vertex kind is off-chain.

Function vertex_kind_tool_fqn

Returns the tool fully-qualified name of the vertex kind.

Function output_variant_is_err_eval

Returns true if the output variant is the reserved _err_eval variant.

Function vertex_input_port

Derives the input port.

Function vertex_input_port_from_string

Builds a vertex input port from the vertex and port ASCII names.

Function vertex_input_port_vertex

Returns the vertex component of the vertex input port.

Function vertex_input_port_port

Returns the input port component of the vertex input port.

Function output_variant_port

Combines an output variant and output port into an output variant port.

Function output_variant_port_variant

Returns the output variant component of the output variant port.

Function output_variant_port_port

Returns the output port component of the output variant port.

Function edge

Creates an edge from an output variant port to a vertex input port with the given kind.

Function edge_from

Returns the edge's source output variant port.

Function edge_to

Returns the edge's destination vertex input port.

Function edge_kind

Returns the edge's kind.

Function edge_from_variant

Returns the output variant of the edge's source port.

Function edge_from_port

Returns the output port of the edge's source port.

Function edge_to_vertex

Returns the destination vertex of the edge.

Function edge_to_port

Returns the destination input port of the edge.

Function inputs_to_begin_execution

Helper to construct inputs for [execution_entries::begin_execution]. Creates a map from a row based input (ie. repeat vertex name for each row).

Function tagged_output_to_dag_types

Converts a tagged output into its DAG output variant and per-port data map.

Function tagged_output_parts_to_dag_types

Converts raw tagged-output parts into a DAG output variant and per-port data map.

Function vertex_name

Returns the vertex name.

Function sorted_output_ports

Returns the map's output ports sorted ascending by their name bytes.

Function submitted_output_payload_sha256

Computes a deterministic SHA-256 digest over the output variant name and its ports and data, sorted by port name for a stable ordering.

Function sorted_input_ports

Returns the input ports sorted ascending by their name bytes.

Last updated