uor_foundation/lib.rs
1// @generated by uor-crate from uor-ontology — do not edit manually
2
3//! UOR Foundation — typed Rust traits for the complete ontology.
4//!
5//! Version: 7.0.0
6//!
7//! This crate exports every ontology class as a trait, every property as a
8//! method, and every named individual as a constant. Implementations (like
9//! PRISM) import these traits and provide concrete types.
10//!
11//! # Primitives
12//!
13//! All traits are generic over [`Primitives`], a type family that lets
14//! implementors choose their own concrete representations for XSD types.
15//!
16//! ```rust,ignore
17//! struct MyImpl;
18//! impl uor_foundation::Primitives for MyImpl {
19//! type String = str;
20//! type Integer = i64;
21//! type NonNegativeInteger = u64;
22//! type PositiveInteger = u64;
23//! type Decimal = f64;
24//! type Boolean = bool;
25//! }
26//! ```
27//!
28//! # Module Structure
29//!
30//! - [`kernel`] — Immutable foundation: addressing, schema, operations
31//! - [`bridge`] — Kernel-computed, user-consumed: queries, resolution, partitions, proofs
32//! - [`user`] — Runtime declarations: types, morphisms, state
33
34#![no_std]
35
36pub mod bridge;
37pub mod enums;
38pub mod kernel;
39pub mod user;
40
41pub use enums::*;
42
43/// XSD primitive type family.
44/// Implementors choose concrete representations for each XSD type.
45/// PRISM might use `u64` for integers at Q0, `u128` at higher quantum
46/// levels, or a bignum library. The foundation does not constrain this choice.
47pub trait Primitives {
48 /// String type (`xsd:string`). Use `str` for borrowed, `String` for owned.
49 type String: ?Sized;
50 /// Integer type (`xsd:integer`).
51 type Integer;
52 /// Non-negative integer type (`xsd:nonNegativeInteger`).
53 type NonNegativeInteger;
54 /// Positive integer type (`xsd:positiveInteger`).
55 type PositiveInteger;
56 /// Decimal type (`xsd:decimal`).
57 type Decimal;
58 /// Boolean type (`xsd:boolean`).
59 type Boolean;
60}