ruwebframe 0.1.3

a simple webframe for rust actix-web, based on rudi and rbatis.
Documentation
use serde::de::DeserializeOwned;
use crate::rubase::rutils::jsonutils;
use serde::Serialize;
//单实例
pub trait BaseEntitySingle   {
    fn if_single(&self) -> bool { true }
    fn init(&mut self) {}
    fn shutdown(&mut self) {}
    fn auto_init(&self) -> bool { false }
    fn to_json (&self) -> String
    where
        Self: Serialize,
    {
        jsonutils::struct2json(&self).unwrap()
    }
    fn from_json(&self, from: String) -> Self
    where
        Self: Serialize+DeserializeOwned,
    {
        jsonutils::json2struct(from.as_str()).unwrap()
    }
}