Crate entidb_storage

Crate entidb_storage 

Source
Expand description

§EntiDB Storage

Storage backend trait and implementations for EntiDB.

This crate provides the lowest-level storage abstraction for EntiDB. Storage backends are opaque byte stores - they do not interpret the data they store.

§Design Principles

  • Backends are simple byte stores (read, append, flush)
  • No knowledge of EntiDB file formats, WAL, or segments
  • Must be Send + Sync for concurrent access
  • EntiDB owns all file format interpretation

§Available Backends

§Example

use entidb_storage::{StorageBackend, InMemoryBackend};

let mut backend = InMemoryBackend::new();
let offset = backend.append(b"hello world").unwrap();
let data = backend.read_at(offset, 11).unwrap();
assert_eq!(&data, b"hello world");

Structs§

EncryptedBackend
An encrypted storage backend that wraps another backend.
EncryptionKey
Encryption key for the encrypted backend.
FileBackend
A file-based storage backend.
InMemoryBackend
An in-memory storage backend.

Enums§

StorageError
Errors that can occur during storage operations.

Constants§

KEY_SIZE
Size of AES-256 key in bytes.
NONCE_SIZE
Size of GCM nonce in bytes.
TAG_SIZE
Size of GCM authentication tag in bytes.

Traits§

StorageBackend
A low-level storage backend for EntiDB.

Type Aliases§

StorageResult
Result type for storage operations.