| Crates.io | dustdata |
| lib.rs | dustdata |
| version | 2.0.0-beta.6 |
| created_at | 2022-06-18 01:01:33.737643+00 |
| updated_at | 2025-01-22 14:34:13.025471+00 |
| description | A data concurrency control storage engine to Rustbase |
| homepage | https://github.com/rustbase/dustdata |
| repository | https://github.com/rustbase/dustdata |
| max_upload_size | |
| id | 608280 |
| size | 84,474 |
A data concurrency control storage engine to Rustbase
Join our community and chat with other Rust users.
This is a work in progress. The API is not stable yet.
Click here to see how to Contribute
Add the following to your Cargo.toml:
[dependencies]
dustdata = "2.0.0-beta.6"
Initialize a new DustData instance with the default configuration:
use dustdata::DustData;
let mut dustdata = DustData::new(Default::default()).unwrap();
#[derive(Serialize, Deserialize, Clone, Debug)]
struct User {
name: String,
age: u32,
}
let collection = dustdata.collection::<User>("users");
let user = User {
name: "Pedro".to_string(),
age: 21,
};
// Creating a new transaction.
let mut transaction = collection.start_branch();
// Inserting the user into the transaction.
transaction.insert("user:1", user);
// Committing the transaction.
collection.commit(transaction).unwrap();
// Done!
let collection = dustdata.collection::<User>("users").unwrap();
let user = collection.get("user:1").unwrap();