feat: add super trait EAV

This commit is contained in:
2025-09-29 11:40:45 +02:00
parent 3a8c000665
commit 7d348052d5
4 changed files with 14 additions and 0 deletions

View File

@@ -10,6 +10,7 @@ mod tst;
pub use crate::str::attribute::O as Attribute; pub use crate::str::attribute::O as Attribute;
pub use crate::str::entity::O as Entity; pub use crate::str::entity::O as Entity;
pub use crate::str::value::E as Value; pub use crate::str::value::E as Value;
pub use crate::trt::eav::T as EAV;
pub use crate::trt::from_eav::T as FromEAV; pub use crate::trt::from_eav::T as FromEAV;
pub use crate::trt::to_eav::T as ToEAV; pub use crate::trt::to_eav::T as ToEAV;
pub use crate::trt::to_value::T as ToValue; pub use crate::trt::to_value::T as ToValue;

View File

@@ -0,0 +1,11 @@
use crate::*;
/// TODO: INSERT DOCUMENTATION HERE
pub trait T where
Self: FromEAV,
Self: ToEAV,
{
}
// #[cfg(test)]
// mod unit_tests {}

View File

@@ -1,3 +1,4 @@
pub mod eav;
pub mod from_eav; pub mod from_eav;
pub mod to_eav; pub mod to_eav;
pub mod to_value; pub mod to_value;

View File

@@ -7,6 +7,7 @@ mod tests {
pub name: String, pub name: String,
pub price: u64, pub price: u64,
} }
impl EAV for Product {}
impl ToEAV for Product { impl ToEAV for Product {
fn to_eav(self) -> Entity { fn to_eav(self) -> Entity {
Entity::default() Entity::default()