feat: add basic structures for EAV modeling (entity, attribute, value)
This commit is contained in:
@@ -0,0 +1 @@
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
|
||||
@@ -6,3 +6,7 @@ mod mcr;
|
||||
mod str;
|
||||
mod trt;
|
||||
mod tst;
|
||||
|
||||
pub use crate::str::attribute::O as Attribute;
|
||||
pub use crate::str::entity::O as Entity;
|
||||
pub use crate::str::value::E as Value;
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
|
||||
7
01.workspace/heave/src/str/attribute.rs
Normal file
7
01.workspace/heave/src/str/attribute.rs
Normal file
@@ -0,0 +1,7 @@
|
||||
use crate::*;
|
||||
|
||||
#[derive(Debug, PartialEq, Clone)]
|
||||
pub struct O {
|
||||
pub id: String,
|
||||
pub value: Value,
|
||||
}
|
||||
7
01.workspace/heave/src/str/entity.rs
Normal file
7
01.workspace/heave/src/str/entity.rs
Normal file
@@ -0,0 +1,7 @@
|
||||
use crate::*;
|
||||
|
||||
#[derive(Debug, Default, PartialEq, Clone)]
|
||||
pub struct O {
|
||||
pub class: String,
|
||||
pub attributes: std::collections::HashMap<String, Attribute>,
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
pub mod attribute;
|
||||
pub mod entity;
|
||||
pub mod value;
|
||||
|
||||
10
01.workspace/heave/src/str/value.rs
Normal file
10
01.workspace/heave/src/str/value.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
use crate::*;
|
||||
|
||||
#[derive(Debug, PartialEq, PartialOrd, Clone)]
|
||||
pub enum E {
|
||||
Bool(bool),
|
||||
Real(f64),
|
||||
SignedInt(i64),
|
||||
Text(String),
|
||||
UnsignedInt(u64),
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
|
||||
Reference in New Issue
Block a user