Plugin for macro-, mini-quad (quads) to save data in simple local storage using Web Storage API in WASM and local file on a native platforms.

Overview

quad-storage

Docs Crates.io version

This is the crate to save data in persistent local storage in miniquad/macroquad environment. In WASM the data persists even if tab or browser are closed. To achieve that Web Storage API is used. To save data on native platforms, data is just saved to the local file named local.data.

Web demo.

Code example

let storage = &mut quad_storage::STORAGE.lock().unwrap();
storage.set("test", "value");
let value = storage.get("test").unwrap();
dbg!(value);

Usage

Add this to your Cargo.toml dependencies:

quad-storage = "0.1.0"

Usage in WASM

Add file quad-storage/js/quad-storage.js to your project.

Add file sapp-jsutils/js/sapp_jsutils.js file to your project.

Add this lines after loading of gl.js and before loading of your wasm in your index.html:

<script src="sapp_jsutils.js"></script>
<script src="quad-storage.js"></script>

Done! Now you can use this crate.

You might also like...
SubZero - a standalone web server that turns your database directly into a REST/GraphQL api

What is this? This is a demo repository for the new subzero codebase implemented in Rust. subZero is a standalone web server that turns your database

High-performance, lock-free local and concurrent object memory pool with automated allocation, cleanup, and verification.

Opool: Fast lock-free concurrent and local object pool Opool is a high-performance Rust library that offers a concurrent and local object pool impleme

a tokio-enabled data store for triple data

terminusdb-store, a tokio-enabled data store for triple data Overview This library implements a way to store triple data - data that consists of a sub

Implements the packet parser for Gran Turismo 7 telemetry data, allowing a developer to retrieve data from a running game.

gran-turismo-query Implements the packet parser for Gran Turismo 7 telemetry data, allowing a developer to retrieve data from a running game. Features

The rust client for CeresDB. CeresDB is a high-performance, distributed, schema-less, cloud native time-series database that can handle both time-series and analytics workloads.

The rust client for CeresDB. CeresDB is a high-performance, distributed, schema-less, cloud native time-series database that can handle both time-series and analytics workloads.

Postgres Foreign Data Wrapper for Clerk.com API

Pre-requisites Postgres-15 Rust pgrx Getting Started To run the program locally, clone the repository git clone https://github.com/tembo-io/clerk_fdw.

Macro for stating unsafe assumptions in Rust.

assume A macro for stating unsafe assumptions in Rust. Using this macro, one can supply assumptions to the compiler for use in optimization. These ass

A pure Rust database implementation using an append-only B-Tree file format.

nebari nebari - noun - the surface roots that flare out from the base of a bonsai tree Warning: This crate is early in development. The format of the

Notification demon + web server using async Rust
Notification demon + web server using async Rust

Async Rust example Road to the asynchronous Rust Table of Contents About the Project Screenshots Tech Stack Features Getting Started Prerequisites Clo

Comments
  • Split wasm part into a -sys version of this crate

    Split wasm part into a -sys version of this crate

    I was just considering implementing something like this when I remembered to search crates.io first. Thanks for implementing this!

    Would you be ok with me splitting out the wasm part into a crate that just exposes free functions hiding the raw wasm opts and making quad-storage use that new crate on wasm?

    opened by oli-obk 4
  • bump egui versions

    bump egui versions

    Nice library :) I get compilation errors on Fedora 35 which might could be resolved by changing or adding other mesa packages but an upgrade of egui and macroquad-egui also solves this issue.

    opened by macnelly 0
Owner
ilya sheprut
youtu.be/1q0sHf_n_2Y
ilya sheprut
A high-performance storage engine for modern hardware and platforms.

PhotonDB A high-performance storage engine for modern hardware and platforms. PhotonDB is designed from scratch to leverage the power of modern multi-

PhotonDB 466 Jun 22, 2023
SQLite compiled to WASM with pluggable data storage

wasm-sqlite SQLite compiled to WASM with pluggable data storage. Useful to save SQLite in e.g. Cloudflare Durable Objects (example: https://github.com

Markus Ast 36 Dec 7, 2022
A Modern Real-Time Data Processing & Analytics DBMS with Cloud-Native Architecture, built to make the Data Cloud easy

A Modern Real-Time Data Processing & Analytics DBMS with Cloud-Native Architecture, built to make the Data Cloud easy

Datafuse Labs 5k Jan 9, 2023
Mini client for rust.

Labrador   Labrador - Mini client for rust This create offers: A convenient mainstream third-party service client Convenient and quick use of correspo

潘安 13 Dec 9, 2022
Sharded, concurrent mini redis that support http interface implemented in rust

Rudis A mini version of redis server that provides http interface implemented in Rust. The in-memorry kv-storage is sharded and concurrent safe. Inspi

Lorenzo Cao 43 May 30, 2023
Scalable and fast data store optimised for time series data such as financial data, events, metrics for real time analysis

OnTimeDB Scalable and fast data store optimised for time series data such as financial data, events, metrics for real time analysis OnTimeDB is a time

Stuart 2 Apr 5, 2022
Zenith substitutes PostgreSQL storage layer and redistributes data across a cluster of nodes

Zenith substitutes PostgreSQL storage layer and redistributes data across a cluster of nodes

null 5.7k Jan 6, 2023
A Key-Value data storage system. - dorea db

Dorea DB ?? Dorea is a key-value data storage system. It is based on the Bitcask storage model Documentation | Crates.io | API Doucment 简体中文 | English

ZhuoEr Liu 112 Dec 2, 2022
OBKV Table Client is Rust Library that can be used to access table data from OceanBase storage layer.

OBKV Table Client is Rust Library that can be used to access table data from OceanBase storage layer. Its access method is different from JDBC, it skips the SQL parsing layer, so it has significant performance advantage.

OceanBase 4 Nov 14, 2022
Async Lightweight HTTP client using system native library if possible. (Currently under heavy development)

Async Lightweight HTTP Client (aka ALHC) What if we need async but also lightweight http client without using such a large library like reqwest, isahc

SteveXMH 7 Dec 15, 2022