rbs

Crates.iorbs
lib.rsrbs
version4.6.2
created_at2022-08-06 09:41:18.408338+00
updated_at2025-06-07 17:24:55.261296+00
descriptionSerialization framework for ORM
homepagehttps://rbatis.github.io/rbatis.io
repositoryhttps://github.com/rbatis/rbatis
max_upload_size
id639779
size119,581
zxj (zhuxiujia)

documentation

https://rbatis.github.io/rbatis.io

README

rbs

  • rbs is rbatis's impl serde serialize trait crates.
  • The rbs serialization framework is used to serialize parameters and deserialize sql result sets, and provides the value structure as py_ Sql and html_ The intermediate object representation of the expression in sql.

use example

use std::collections::HashMap;
#[derive(serde::Serialize, serde::Deserialize, Debug)]
pub struct A {
    pub name: String,
}

fn main(){
    let a = A {
        name: "sss".to_string(),
    };
    let value = rbs::value(a).unwrap();
    println!("value: {}",value);
    let a: A = rbs::from_value(value).unwrap();
    println!("a:{:?}", a);
    
    //macro
    let val = value! {
            "name": "Alice",
            "age": 30,
            "city": "New York"
        };
    println!("val: {}",val);
}
Commit count: 6108

cargo fmt