Skip to main content

Crate uor_foundation_sdk

Crate uor_foundation_sdk 

Source
Expand description

UOR Foundation SDK — procedural-macro ergonomics for uor-foundation.

Emitted by codegen/src/sdk_macros.rs from the ontology. Consumers of this crate must also depend on uor-foundation; the macros emit absolute-path references (::uor_foundation::…) that resolve in the consumer’s dependency graph.

§Macros

  • product_shape! — emits a ConstrainedTypeShape impl and a mint_product_witness helper for the UOR product type A × B (PT_1 / PT_2a / PT_3 / PT_4).
  • coproduct_shape! — emits a ConstrainedTypeShape impl and a mint_coproduct_witness helper for the UOR sum type A + B (ST_1 / ST_2 / ST_6 / ST_7 / ST_8 / ST_9 / ST_10).
  • cartesian_product_shape! — emits a ConstrainedTypeShape impl, a CartesianProductShape marker impl, and a mint_cartesian_witness helper for the UOR Cartesian-partition product A ⊠ B (CPT_1 / CPT_2a / CPT_3 / CPT_4 / CPT_5).
  • prism_model! — emits the seal impls (__sdk_seal::Sealed for the model and the route witness), the FoundationClosed impl on the route witness, and the PrismModel<H, B, A> impl whose forward body delegates to pipeline::run_route (wiki ADR-020 + ADR-022 D1, D3, D4, D5).

§Operand support

Operand CONSTRAINTS arrays may contain every ConstraintRef variant: Residue, Hamming, Depth, Carry, Site, Affine, SatClauses, Bound, and Conjunction. Phase 17 stores Affine.coefficients as a fixed-size [i64; AFFINE_MAX_COEFFS] array (capacity 8) and limits Conjunction.conjuncts to a [LeafConstraintRef; CONJUNCTION_MAX_TERMS] depth-1 array; both are stable-Rust const-buildable, so the SDK macros support the full operand catalogue. Inputs exceeding the caps fail validate_const() with a typed ShapeViolation.

Macros§

axis
axis! — wiki ADR-030 substrate-extension axis declaration.
cartesian_product_shape
Cartesian-product shape constructor. See crate-level docs.
coproduct_shape
Coproduct shape constructor. See crate-level docs.
output_shape
output_shape! — wiki ADR-027 custom Output shape declaration.
partition_coproduct
partition_coproduct! — wiki ADR-026 G18 type-level shape constructor. Variadic named form. Folds left-associatively into binary coproducts. Each binary step emits the same shape coproduct_shape! produces (ST_10 canonical structure).
partition_product
partition_product! — wiki ADR-026 G17 type-level shape constructor. Emits a ConstrainedTypeShape impl whose CONSTRAINTS carry the canonically-joined PT_3 form (algebraic-product per ADR-025), with SITE_COUNT = Σ operands' SITE_COUNT.
prism_model
prism_model! — wiki ADR-020 + ADR-022 D3 closure-bodied form.
product_shape
Product-type shape constructor. See crate-level docs.
register_shape
register_shape! — wiki ADR-057 shape-IRI registration. Emits a marker type + ShapeRegistryProvider impl whose REGISTRY const carries one RegisteredShape entry per shape, populated from each shape’s ConstrainedTypeShape associated items.
resolver
resolver! — wiki ADR-036 ResolverTuple declaration macro.
use_verbs
use_verbs! — wiki ADR-024 cross-implementation verb imports.
verb
verb! — wiki ADR-024 Layer-3 verb declaration. Emits a const term-tree fragment and a public accessor.