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 types::meta::{DataType, MetaErr};
19pub use types::value::{DateTimeValue, DomainT, EmailT, IdCardT, Maker, MobilePhoneT, UrlValue};
20pub use types::value::{DigitValue, FloatValue, HexT, IgnoreT, IpNetValue};
21pub use data::storage::FieldStorage;
22
23/// 字段名称类型
24/// 当前实现:SmolStr(小字符串优化,≤22字节内联存储)
25/// 未来可以根据性能测试调整为其他实现
26pub type FNameStr = smol_str::SmolStr;
27
28/// 字段值字符串类型
29/// 当前实现:SmolStr(小字符串优化,≤22字节内联存储)
30/// 用于 Value::Chars,提供高效的短字符串存储
31pub type FValueStr = smol_str::SmolStr;
32
33/// Data field type: Field with Value
34pub type DataField = Field<Value>;
35
36/// Data record type with mixed storage (Arc + Owned fields)
37///
38/// BREAKING CHANGE (v0.8.0): Changed from Record<Field<Value>> to Record<FieldStorage>
39/// to support zero-copy sharing of static/constant fields.
40pub type DataRecord = Record<FieldStorage>;
41
42/// Legacy shared record type (for Arc<Field<Value>>)
43pub type SharedRecord = Record<Arc<DataField>>;
44
45//pub use conv::to_shared_field_vec;
46//pub use conv::to_value_field_vec;