Skip to main content

wp_model_core/model/
mod.rs

1use crate::model::data::record::Record;
2pub use crate::model::types::value::Value;
3pub use data::field::Field;
4pub use data::record::Record as RecordStruct;
5use std::sync::Arc;
6pub mod error;
7pub mod fmt_def;
8pub mod format;
9mod macros;
10
11//pub mod array;
12// compare impls moved to orion_exp adapters
13//mod conv;
14pub mod data;
15pub mod types;
16// conditions impls moved out; core remains pure types + format
17
18pub use data::field_ref::FieldRef;
19pub use data::storage::FieldStorage;
20pub use types::meta::{DataType, MetaErr};
21pub use types::value::{DateTimeValue, DomainT, EmailT, IdCardT, Maker, MobilePhoneT, UrlValue};
22pub use types::value::{DigitValue, FloatValue, HexT, IgnoreT, IpNetValue};
23
24/// 字段名称类型
25/// 当前实现:SmolStr(小字符串优化,≤22字节内联存储)
26/// 未来可以根据性能测试调整为其他实现
27pub type FNameStr = smol_str::SmolStr;
28
29/// 字段值字符串类型
30/// 当前实现:SmolStr(小字符串优化,≤22字节内联存储)
31/// 用于 Value::Chars,提供高效的短字符串存储
32pub type FValueStr = smol_str::SmolStr;
33
34/// Data field type: Field with Value
35pub type DataField = Field<Value>;
36
37/// Data record type with mixed storage (Arc + Owned fields)
38///
39/// BREAKING CHANGE (v0.8.0): Changed from Record<Field<Value>> to Record<FieldStorage>
40/// to support zero-copy sharing of static/constant fields.
41pub type DataRecord = Record<FieldStorage>;
42
43/// Legacy shared record type (for Arc<Field<Value>>)
44pub type SharedRecord = Record<Arc<DataField>>;
45
46//pub use conv::to_shared_field_vec;
47//pub use conv::to_value_field_vec;