Skip to main content

Crate oxistore

Crate oxistore 

Source
Expand description

oxistore — Pure Rust storage facade for the COOLJAPAN ecosystem.

This crate re-exports the core traits from oxistore_core and provides the open / open_with / open_in_memory convenience functions that return a Box<dyn KvStore> backed by the selected engine.

§Default backend

The kv-redb feature (enabled by default) selects redb as the backing store. Pass --features kv-sled to use sled instead (or in addition).

§Feature flags

FeatureDescription
kv-redbredb backend (default)
kv-sledsled backend
kv-fjallfjall LSM-tree backend
columnarParquet/Arrow columnar storage
cacheLRU and ARC cache primitives
blobBlob storage with local + memory backends
encryptCell-level AEAD encryption decorator

§Example

use oxistore::{open, KvStore};

let store = open(&path).expect("open failed");
store.put(b"hello", b"world").expect("put failed");
let val = store.get(b"hello").expect("get failed");
assert_eq!(val.as_deref(), Some(b"world".as_ref()));

Modules§

kv_redb
Re-exports for the redb backend (available when the kv-redb feature is enabled).
prelude
Prelude module — import commonly used types with use oxistore::prelude::*.

Structs§

StoreConfig
Backend-agnostic configuration for opening a store.
StoreMetrics
Runtime statistics for a store (reads, writes, cache hits, etc.).

Enums§

Backend
Unified backend type discriminant covering all storage engine types.
StoreError
Errors that can be returned by any OxiStore backend.
StoreKind
Which backend engine to use when opening a store.

Traits§

BlobStore
Marker trait for blob stores that is compatible with oxistore-blob::BlobStore.
ColumnarStore
Stub trait for M2+ columnar store — defined here so facade re-exports remain stable.
KvSnapshot
A point-in-time read-only view of the store obtained from KvStore::snapshot.
KvStore
Core key-value store trait.
KvTxn
An explicit write transaction obtained from KvStore::transaction.

Functions§

backup_store
Create a backup of the store at src (opened with kind) to dst.
destroy
Destroy (remove) the store at path for the given kind.
detect_backend
Attempt to detect which backend engine created the store at path.
expiry_epoch_millis
Encode a TTL as an expiry unix-epoch-milliseconds u64.
is_expired
Return true if an epoch-milliseconds timestamp is in the past.
open
Open a KvStore at path using the default backend (redb).
open_config
Open a KvStore at path with a StoreConfig using the default backend (redb).
open_in_memory
Open an ephemeral in-memory KvStore for the specified backend.
open_read_only
Open an existing KvStore at path in read-only mode (default backend: redb).
open_with
Open a KvStore at path using the specified kind.
prefix_upper_bound
Compute the exclusive upper-bound key for a prefix scan.
restore_store
Restore a store at dst from a backup at backup_path using kind.

Type Aliases§

BoxKvStore
Convenience alias: a heap-allocated KvStore with 'static lifetime.
KeysIter
A boxed iterator over keys (without values) with a given lifetime.
RangeItem
A single item produced by a range scan: a (key, value) pair or an error.
RangeIter
A boxed iterator over RangeItems with a given lifetime.