Crates.io | gzbbinarydoc |
lib.rs | gzbbinarydoc |
version | 0.1.0 |
source | src |
created_at | 2022-12-08 05:42:30.207869 |
updated_at | 2022-12-08 05:42:30.207869 |
description | this is a json like object structure to organize data.supported data types are binary(Vec |
homepage | https://github.com/gzbakku/gzbbinarydoc |
repository | https://github.com/gzbakku/gzbbinarydoc |
max_upload_size | |
id | 732374 |
size | 29,174 |
this is a very fast binary document structure to save supported data.
use gzbbinarydoc::DocValue;
fn main(){
let mut person = DocValue::object();
person.insert("name","akku");
person.insert("bin",vec![1,2,3]);
person.insert("age",24);
person.insert("avg score",12.65);
person.insert(&"king",true);
person.insert("network",());//null type
let mut scores = DocValue::vec();
scores.push(12.5);
scores.push(15);
scores.push(());
scores.push(false);
let mut game_match = DocValue::object();
game_match.insert("scores",scores);
let mut game = DocValue::object();
game.insert("match", game_match);
game.insert("game","cricket");
person.insert("sports",game);
println!("{:?}",person);
let bin = person.write();
let rebuild = DocValue::read(&bin);
println!("rebuild : {:#?}",rebuild);
}