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 + Syncfor concurrent access - EntiDB owns all file format interpretation
§Available Backends
InMemoryBackend- For testing and ephemeral storageFileBackend- For persistent storage using OS file APIsEncryptedBackend- Wrapper that adds AES-256-GCM encryption
§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§
- Encrypted
Backend - An encrypted storage backend that wraps another backend.
- Encryption
Key - Encryption key for the encrypted backend.
- File
Backend - A file-based storage backend.
- InMemory
Backend - An in-memory storage backend.
Enums§
- Storage
Error - 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§
- Storage
Backend - A low-level storage backend for EntiDB.
Type Aliases§
- Storage
Result - Result type for storage operations.