Skip to main content

golem_schema/schema/
mod.rs

1// Copyright 2024-2026 Golem Cloud
2//
3// Licensed under the Golem Source License v1.1 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://license.golem.cloud/LICENSE
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! Recursive in-memory mirror of the `golem:core@2.0.0` schema model.
16
17pub mod canonical;
18pub mod conversion;
19pub mod derive;
20pub mod fingerprint;
21pub mod graph;
22pub mod host_managed;
23pub mod metadata;
24pub mod multimodal;
25#[cfg(feature = "full")]
26pub mod protobuf;
27pub mod render;
28pub mod schema_type;
29pub mod schema_value;
30pub mod stream;
31pub mod tool;
32pub mod unstructured;
33pub mod validation;
34#[cfg(all(
35    any(feature = "guest", feature = "host"),
36    not(all(feature = "guest", feature = "host"))
37))]
38pub mod wit;
39
40#[cfg(any(test, feature = "proptest"))]
41pub mod proptest_strategies;
42
43pub use conversion::{
44    DecodeError, FromSchema, FromSchemaError, IntoSchema, IntoTypedSchemaValue, MergeError,
45    Quantity, QuantityUnit, SchemaBuilder, merge_agent_graphs, try_into_schema_graph,
46    try_into_typed_schema_value,
47};
48pub use fingerprint::{
49    SchemaFingerprintError, SchemaFingerprintV1, resolve_stream_element_schema_v1,
50    schema_fingerprint_v1,
51};
52#[cfg(feature = "derive")]
53pub use golem_schema_derive::{FromSchema, FromWire, IntoSchema, IntoWire, Schema, WireSchema};
54pub use graph::{SchemaGraph, SchemaTypeDef, TypedSchemaValue};
55pub use host_managed::{
56    HostManagedKind, HostManagedOccurrence, HostManagedTraversalError, RedactedSchemaValue,
57    find_host_managed_type, find_host_managed_value, redacted_schema_value_debug,
58};
59pub use metadata::{MetadataEnvelope, Role, TypeId};
60pub use schema_type::{
61    BinaryRestrictions, DiscriminatorRule, FieldDiscriminator, NamedFieldType, PathDirection,
62    PathKind, PathSpec, PermissionCardSpec, QuantitySpec, QuantityValue, QuotaTokenSpec,
63    ResultSpec, SchemaType, SecretSpec, TextRestrictions, UnionBranch, UnionSpec, UrlRestrictions,
64    VariantCaseType,
65};
66pub use schema_value::{
67    BinaryValuePayload, DurationValuePayload, PermissionCardValuePayload, QuotaTokenValuePayload,
68    ResultValuePayload, SchemaValue, SecretValuePayload, TextValuePayload, UnionValuePayload,
69    VariantValuePayload,
70};
71pub use stream::SchemaValueStream;
72#[cfg(all(feature = "host", not(feature = "guest")))]
73pub use stream::SchemaValueStreamHandleRep;