1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
//! RON Schema - Schema types, validation, and storage for RON files.
//!
//! This module provides:
//! - Schema type definitions for representing Rust types
//! - Trait-based schema system for custom types
//! - Storage utilities for reading/writing schema files
//! - Validation of RON values against schemas
//!
//! # Quick Start
//!
//! Most users only need these imports:
//!
//! ```rust
//! use ron2::schema::{Schema, TypeKind, Field, RonSchema};
//! ```
//!
//! # API Tiers
//!
//! This module provides a **minimal public API** at the root level. Advanced
//! functionality is available through submodules:
//!
//! - **Root level**: Core types, traits, and common operations
//! - **Submodules**: Advanced validation functions, storage utilities, error details
//!
//! ## Submodule Access
//!
//! For advanced use cases, access the submodules directly:
//!
//! ```rust,ignore
//! // Advanced validation functions
//! use ron2::schema::validation::{validate_type, validate_with_resolver};
//!
//! // Storage internals
//! use ron2::schema::storage::{type_path_to_file_path, resolve_schema_dir};
//!
//! // Schema collection internals
//! use ron2::schema::collect::{SchemaCatalog, SchemaEntry, collect_schemas};
//! ```
//!
//! # Trait-Based Schema System
//!
//! The schema system is built on the [`RonSchema`] trait:
//!
//! - [`RonSchema`] - Core trait for types representable in schemas
//! - [`RonList`] - Marker trait for list/sequence-like types
//! - [`RonMap`] - Marker trait for map/dictionary-like types
//! - [`RonOptional`] - Marker trait for optional/nullable types
//!
//! ## Implementing Custom Types
//!
//! ```rust,ignore
//! use ron2::schema::{RonSchema, RonList, TypeKind};
//!
//! // A custom list type
//! struct MyVec<T>(Vec<T>);
//!
//! impl<T: RonSchema> RonSchema for MyVec<T> {
//! fn type_kind() -> TypeKind {
//! TypeKind::List(Box::new(T::type_kind()))
//! }
//! }
//!
//! // Mark it as a list type for additional type information
//! impl<T: RonSchema> RonList for MyVec<T> {
//! type Element = T;
//! }
//! ```
//!
//! # Creating Schemas Manually
//!
//! ```rust,ignore
//! use ron2::{ToRon, schema::{Schema, TypeKind, Field}};
//!
//! // Define a schema for a config struct
//! let schema = Schema::with_doc(
//! "Application configuration",
//! TypeKind::Struct {
//! fields: vec![
//! Field::new("port", TypeKind::U16).with_doc("Server port"),
//! Field::optional("host", TypeKind::String).with_doc("Hostname"),
//! ],
//! },
//! );
//!
//! // Serialize to RON using the ToRon trait
//! let ron_str = schema.to_ron().unwrap();
//! println!("{}", ron_str);
//! ```
// Submodules - public for advanced access
// =============================================================================
// Core Types
// =============================================================================
// =============================================================================
// Storage (derive feature only)
// =============================================================================
pub use write_schemas;
// =============================================================================
// Errors
// =============================================================================
pub use ;
pub use ;
// =============================================================================
// Traits
// =============================================================================
pub use ;
pub use ;
// =============================================================================
// Validation
// =============================================================================
pub use ;