ruwebframe 0.1.7

a simple webframe for rust actix-web, based on rudi and rbatis.
Documentation
use serde::de::DeserializeOwned;
use serde::Serialize;
use crate::rubase::rutils::json_utils;

//多实例
pub trait BaseTrait<Q> {

    fn if_single(&self) -> bool { false }
    fn init(&mut self) {}
    fn shutdown(&mut self) {}
    fn auto_init(&self) -> bool { false }
    fn to_json(&self) -> String
    where
        Self: Serialize,
    {
        json_utils::struct2json(&self).unwrap()
    }
    fn from_json( &self, from: String) -> Self
    where
        Self: Serialize+DeserializeOwned,
    {
        json_utils::json2struct(from.as_str()).unwrap()
    }

}