unity_asset_yaml/lib.rs
1//! Unity Asset YAML Parser
2//!
3//! YAML format support for Unity asset parsing, providing a robust and efficient
4//! Unity YAML loader based on the mature serde_yaml library.
5//!
6//! This crate provides parsing of Unity YAML files while maintaining exact
7//! compatibility with Unity's format.
8//!
9//! # Examples
10//!
11//! ```rust
12//! use unity_asset_yaml::serde_unity_loader::SerdeUnityLoader;
13//!
14//! let loader = SerdeUnityLoader::new();
15//! let yaml = r#"
16//! GameObject:
17//! m_Name: Player
18//! m_IsActive: 1
19//! "#;
20//!
21//! let classes = loader.load_from_str(yaml)?;
22//! # Ok::<(), Box<dyn std::error::Error>>(())
23//! ```
24
25// Re-export core types
26pub use unity_asset_core::{
27 DocumentFormat, Result, UnityAssetError, UnityClass, UnityClassRegistry, UnityValue,
28 constants::*,
29};
30
31// Core modules
32pub mod constants;
33pub mod python_like_api;
34pub mod serde_unity_loader;
35pub mod unity_yaml_serializer;
36pub mod yaml_document;
37
38// Re-export main types
39pub use serde_unity_loader::SerdeUnityLoader;
40pub use unity_yaml_serializer::UnityYamlSerializer;
41pub use yaml_document::YamlDocument;
42
43#[cfg(test)]
44mod tests {
45 use super::*;
46
47 #[test]
48 fn test_basic_functionality() {
49 // Test that we can create a serde loader
50 let _loader = SerdeUnityLoader::new();
51
52 // Test that we can create a YAML document
53 let _doc = YamlDocument::new();
54 }
55}