Skip to main content

paramodel_elements/
lib.rs

1// Copyright (c) Jonathan Shook
2// SPDX-License-Identifier: Apache-2.0
3
4//! Paramodel — the central algebra crate.
5//!
6//! Everything paramodel models lives here: the parameter algebra
7//! (parameter / domain / constraint / value / validation / expression),
8//! the attribute layer (labels, tags, plugs, sockets, wires), the
9//! element model (`Element`, `Dependency`, runtime), and the
10//! trial-as-element-parameterization layer (`Trial`, `Assignments`).
11//!
12//! The crate was formerly split into `paramodel-core` and
13//! `paramodel-elements`, with `Trial` living in `paramodel-trials`.
14//! That split cost indirection without buying value — `Trial` is a
15//! specific parameterization of an element graph over specific
16//! coordinates, which puts it in the same semantic unit as `Element`.
17//! Downstream specialisation (trial sets, outcomes, plans,
18//! compilation, execution) still lives in sibling crates — this one
19//! is the algebra they're built on.
20
21// ---- parameter algebra + core primitives (formerly paramodel-core) ----
22pub mod attributes;
23pub mod constraint;
24pub mod domain;
25pub mod error;
26pub mod expression;
27pub mod fingerprint;
28pub mod ids;
29pub mod names;
30pub mod parameter;
31pub mod validation;
32pub mod value;
33
34// ---- trial as a parameterization of the element graph ----
35pub mod trial;
36
37// ---- element model (declarative + runtime) ----
38pub mod configuration;
39pub mod dependency;
40pub mod element;
41pub mod lifecycle;
42pub mod runtime;
43pub mod types;
44
45// ---------------------------------------------------------------------------
46// Public re-exports.
47// ---------------------------------------------------------------------------
48
49pub use attributes::{
50    AttributeError, Attributed, Facet, FacetKey, FacetValue, LabelKey, LabelValue, Labels, Plug,
51    Pluggable, PortName, Socket, TagKey, TagValue, Tags, Tier, Wire, WireMatch, fits,
52    validate_namespace, wiring_for,
53};
54pub use configuration::{ConfigEntry, Configuration, ExportName, Exports, TokenExpr};
55pub use constraint::{
56    BoolConstraint, Constraint, DoubleConstraint, IntConstraint, SelectionConstraint,
57    StringConstraint,
58};
59pub use dependency::{Dependency, RelationshipType};
60pub use domain::{
61    Cardinality, Domain, DomainError, DoubleDomain, IntegerDomain, LabeledEntry,
62    LabeledSelectionResolver, RegexPattern, ResolverId, SelectionDomain, SelectionResolver,
63    SelectionResolverRegistry, StringDomain,
64};
65pub use element::Element;
66pub use error::{ElementError, Error, Result};
67pub use expression::{
68    BinOp, BuiltinFn, DerivationError, EvalValue, Expression, Literal, UnOp, ValueBindings,
69};
70pub use fingerprint::{Fingerprint, FingerprintBuilder};
71pub use ids::TrialId;
72pub use lifecycle::{
73    HealthCheckSpec, LiveStatusSummary, OperationalState, ShutdownSemantics, StateTransition,
74};
75pub use names::{ElementName, Name, NameError, ParameterName};
76pub use parameter::{
77    BooleanParameter, DerivedParameter, DoubleParameter, IntegerParameter, Parameter,
78    ParameterError, SelectionParameter, StringParameter,
79};
80pub use runtime::{
81    ElementRuntime, ElementRuntimeRegistry, MaterializationOutputs, ResolvedConfiguration,
82    StateObservation, StateTransitionListener, TrialContext,
83};
84pub use trial::{Assignments, TRIAL_TAG, Trial, TrialError, TrialMetadata};
85pub use types::{
86    ElementTypeDescriptor, ElementTypeDescriptorRegistry, OpenRegistry, TypeId,
87};
88pub use validation::ValidationResult;
89pub use value::{
90    BooleanValue, BoundaryKind, DoubleValue, GeneratorInfo, IntegerValue, Provenance,
91    SelectionItem, SelectionValue, StringValue, Value, ValueKind,
92};