use crate::{ColumnTrait, QueryResult, TypeErr}; pub use sea_query::Value; use std::fmt::Debug; pub trait ModelTrait: Clone + Debug { type Column: ColumnTrait; fn get(&self, c: Self::Column) -> Value; fn set(&mut self, c: Self::Column, v: Value); fn from_query_result(res: &QueryResult, pre: &str) -> Result where Self: Sized; } pub trait FromQueryResult { fn from_query_result(res: &QueryResult, pre: &str) -> Result where Self: Sized; } impl FromQueryResult for M where M: ModelTrait + Sized, { fn from_query_result(res: &QueryResult, pre: &str) -> Result { ::from_query_result(res, pre) } }