sea-orm/src/entity/model.rs
2021-05-09 15:28:03 +08:00

16 lines
386 B
Rust

use crate::{ColumnTrait, QueryResult, TypeErr};
pub use sea_query::Value;
use std::fmt::Debug;
pub trait ModelTrait: Clone + Debug + Default {
type Column: ColumnTrait;
fn get(&self, c: Self::Column) -> Value;
fn set(&mut self, c: Self::Column, v: Value);
fn from_query_result(row: QueryResult) -> Result<Self, TypeErr>
where
Self: std::marker::Sized;
}