ruwebframe 0.1.8

a simple webframe for rust actix-web, based on rudi and rbatis.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use serde::de::DeserializeOwned;
use serde::Serialize;
use crate::rubase::rutils::json_utils;

trait JsonTrait {
     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()
     }
}