ruwebframe 0.1.7

a simple webframe for rust actix-web, based on rudi and rbatis.
Documentation
use serde::de::DeserializeOwned;
 
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) ->  Result<String, serde_json::Error>
    where
        Self: Serialize,  {
        serde_json::to_string(self) // 直接用 serde,省去 json_utils 包装
    }

    fn from_json(&self, from: String) -> Result<Self, serde_json::Error>
    where
        Self: Serialize+DeserializeOwned,
    {
        serde_json::from_str(from.as_str())
    }
     
}