review: remove the possibility to insert raw entities into catalog
This commit is contained in:
@@ -1,20 +0,0 @@
|
|||||||
use crate::*;
|
|
||||||
|
|
||||||
impl From<Value> for Entity {
|
|
||||||
fn from(value: Value) -> Entity {
|
|
||||||
let id = match value {
|
|
||||||
Value::Text(value) => value,
|
|
||||||
_ => panic!("Type mismatch"),
|
|
||||||
};
|
|
||||||
Entity {
|
|
||||||
id,
|
|
||||||
ref_date: None,
|
|
||||||
state: EntityState::Unknown,
|
|
||||||
class: String::new(),
|
|
||||||
attributes: std::collections::HashMap::new(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// #[cfg(test)]
|
|
||||||
// mod unit_tests { use super::*; }
|
|
||||||
@@ -1,18 +1,9 @@
|
|||||||
pub mod bool_from_value;
|
pub mod bool_from_value;
|
||||||
// pub mod bool_to_value;
|
|
||||||
pub mod entity_from_value;
|
|
||||||
// pub mod entity_to_value;
|
|
||||||
pub mod f64_from_value;
|
pub mod f64_from_value;
|
||||||
// pub mod f64_to_value;
|
|
||||||
pub mod i64_from_value;
|
pub mod i64_from_value;
|
||||||
// pub mod i64_to_value;
|
|
||||||
// pub mod str_to_value;
|
|
||||||
pub mod string_from_value;
|
pub mod string_from_value;
|
||||||
// pub mod string_to_value;
|
|
||||||
pub mod u64_from_value;
|
pub mod u64_from_value;
|
||||||
// pub mod u64_to_value;
|
|
||||||
pub mod value_from_bool;
|
pub mod value_from_bool;
|
||||||
pub mod value_from_entity;
|
|
||||||
pub mod value_from_f64;
|
pub mod value_from_f64;
|
||||||
pub mod value_from_i64;
|
pub mod value_from_i64;
|
||||||
pub mod value_from_str;
|
pub mod value_from_str;
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
use crate::*;
|
|
||||||
|
|
||||||
impl From<Entity> for Value {
|
|
||||||
fn from(value: Entity) -> Self {
|
|
||||||
Self::Text(value.id)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// #[cfg(test)]
|
|
||||||
// mod unit_tests { use super::*; }
|
|
||||||
@@ -9,12 +9,6 @@ pub struct O {
|
|||||||
pub attributes: std::collections::HashMap<String, Attribute>,
|
pub attributes: std::collections::HashMap<String, Attribute>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl EAV for Entity {
|
|
||||||
fn class() -> &'static str {
|
|
||||||
"entity"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl O {
|
impl O {
|
||||||
pub fn new<T>() -> Self
|
pub fn new<T>() -> Self
|
||||||
where
|
where
|
||||||
|
|||||||
Reference in New Issue
Block a user