Skip to main content

Crate eure_schema

Crate eure_schema 

Source
Expand description

Eure Schema types and structures

This library provides schema type definitions for Eure documents, following the specification in assets/eure-schema.schema.eure.

§Type Variants

All types are variants of SchemaNodeContent:

Primitives:

  • Text - Text type with optional language and length/pattern constraints
  • Integer - Integer type with optional range and multiple-of constraints
  • Float - Float type with optional range and multiple-of constraints
  • Boolean - Boolean type (no constraints)
  • Null - Null type
  • Any - Any type (accepts any value)

Literal:

  • Literal - Exact value match (e.g., status = "active")

Compounds:

  • Record - Fixed named fields
  • Array - Ordered list with item type
  • Map - Dynamic key-value pairs
  • Tuple - Fixed-length ordered elements
  • Union - Tagged union with named variants

Reference:

  • Reference - Type reference (local or cross-schema)

Re-exports§

pub use build::BuildSchema;
pub use build::SchemaBuilder;

Modules§

build
Schema building from Rust types
convert
Conversion from EureDocument to SchemaDocument
identifiers
parse
FromEure implementations for schema types.
synth
Type Synthesis for Eure Documents
validate
Document schema validation

Structs§

ArraySchema
Array type constraints
ExtTypeSchema
Extension type definition with optionality
FloatSchema
Float type constraints
IntegerSchema
Integer type constraints
MapSchema
Map type constraints
RecordFieldSchema
Record field with per-field metadata
RecordSchema
Record type with fixed named fields
SchemaDocument
Schema document with arena-based node storage
SchemaMetadata
Schema metadata (available at any nesting level via $ext-type on $types.type)
SchemaNode
A single schema node
SchemaNodeId
Reference to a schema node by index
SchemaRef
Reference to a schema file from $schema extension.
TextSchema
Text type constraints
TupleSchema
Tuple type with fixed-length ordered elements
TypeReference
Type reference (local or cross-schema)
UnionSchema
Union type with named variants

Enums§

BindingStyle
How to represent document paths in formatted output
Bound
Boundary condition for numeric constraints
Description
Description can be plain string or markdown
FloatPrecision
Float precision specifier
SchemaKind
The kind of a schema node (discriminant without data).
SchemaNodeContent
Type definitions with their specific constraints
UnknownFieldsPolicy
Policy for handling fields not defined in record properties