flosse/r2d2-jfs

JSON file store (jfs) support for the

r2d2-jfs

r2d2-jfs

JSON file store (jfs) support for the r2d2 connection pool.

Example

use std::thread;
use serde::{Serialize, Deserialize};
use r2d2_jfs::JfsConnectionManager;

#[derive(Serialize, Deserialize)]
struct Data { x: i32 }

fn main() {
    let manager = JfsConnectionManager::file("file.json").unwrap();
    let pool = r2d2::Pool::builder().max_size(5).build(manager).unwrap();
    let mut threads = vec![];
    for i in 0..10 {
        let pool = pool.clone();
        threads.push(thread::spawn(move || {
            let d = Data { x: i };
            let conn = pool.get().unwrap();
            conn.save(&d).unwrap();
        }));
    }
    for c in threads {
        c.join().unwrap();
    }
}

License: Apache-2.0 OR MIT

Information - Updated Sep 13, 2021

Stars: 2
Forks: 2
Issues: 0

Repositories & Extras

A simple JSON file store written in Rust

Don't use it if you want to persist a large amount of objects

A simple JSON file store written in Rust

This is a Rust command line tool that calculates a histogram of the separate types...

This is a Rust command line tool that calculates a histogram of the separate types of JSON records in an input JSON log file (one...

This is a Rust command line tool that calculates a histogram of the separate types...

This crate provides the ability to wrap structs in JSON Files which are automatically saved...

This crate provides the ability to wrap structs in JSON Files which are automatically saved to disk when dropped and can be reloaded from disk...

This crate provides the ability to wrap structs in JSON Files which are automatically saved...

JSON File Parser

A CLI application that reads from a stream of JSON files, and computes some data-quality metrics

JSON File Parser

What can this project do?

Given the name of a city and a server from command line, we will generate related information and store them into a json file

What can this project do?

Zotero to Obsidian script

This is a script that takes a better bibtex JSON file exported by Zotero and generates an organised collection of reference notes in Obsidian

Zotero to Obsidian script

JSON Compilation Database

This crate provides support for reading and writing JSON compilation database files

JSON Compilation Database

This project offers an implementation of a customer registry and/or crates

Configuration is done via a JSON config file

This project offers an implementation of a customer registry and/or crates

Syntax-Analyzer-rs

A Rust binary crate that is used to validate JSON files with trailing commas,comments and multiline strings

Syntax-Analyzer-rs

A RUST based CLI application which parse json to send API requests

Automate requests with a json file 🚀

A RUST based CLI application which parse json to send API requests
Facebook Instagram Twitter GitHub Dribbble
Privacy