pub struct EncryptedWosBackend { /* private fields */ }Expand description
Tier 3 with transparent encryption: sled-backed storage with AEAD encryption.
All values are encrypted before being written to sled and decrypted on read. Keys remain in plaintext to preserve ordered iteration and range scans.
Implementations§
Source§impl EncryptedWosBackend
impl EncryptedWosBackend
Sourcepub fn open(path: &Path, encryption: EncryptionConfig) -> DbxResult<Self>
pub fn open(path: &Path, encryption: EncryptionConfig) -> DbxResult<Self>
Open an encrypted WOS at the given directory path.
Sourcepub fn open_temporary(encryption: EncryptionConfig) -> DbxResult<Self>
pub fn open_temporary(encryption: EncryptionConfig) -> DbxResult<Self>
Open a temporary encrypted WOS (for testing).
Sourcepub fn encryption_config(&self) -> &EncryptionConfig
pub fn encryption_config(&self) -> &EncryptionConfig
Get a reference to the encryption config.
Sourcepub fn rekey(&mut self, new_encryption: EncryptionConfig) -> DbxResult<usize>
pub fn rekey(&mut self, new_encryption: EncryptionConfig) -> DbxResult<usize>
Re-key all data with a new encryption config.
Reads all existing data, decrypts with the current key, and re-encrypts with the new key.
§Warning
This operation is NOT atomic — if interrupted, some data may be encrypted with the old key and some with the new key. Always checkpoint/backup before re-keying.
Trait Implementations§
Source§impl StorageBackend for EncryptedWosBackend
impl StorageBackend for EncryptedWosBackend
Source§fn insert(&self, table: &str, key: &[u8], value: &[u8]) -> DbxResult<()>
fn insert(&self, table: &str, key: &[u8], value: &[u8]) -> DbxResult<()>
Insert a key-value pair.
Source§fn insert_batch(
&self,
table: &str,
rows: Vec<(Vec<u8>, Vec<u8>)>,
) -> DbxResult<()>
fn insert_batch( &self, table: &str, rows: Vec<(Vec<u8>, Vec<u8>)>, ) -> DbxResult<()>
Insert multiple key-value pairs in a batch (optimized). Read more
Source§fn scan<R: RangeBounds<Vec<u8>> + Clone>(
&self,
table: &str,
range: R,
) -> DbxResult<Vec<(Vec<u8>, Vec<u8>)>>
fn scan<R: RangeBounds<Vec<u8>> + Clone>( &self, table: &str, range: R, ) -> DbxResult<Vec<(Vec<u8>, Vec<u8>)>>
Scan a range of keys.
Source§fn scan_one<R: RangeBounds<Vec<u8>> + Clone>(
&self,
table: &str,
range: R,
) -> DbxResult<Option<(Vec<u8>, Vec<u8>)>>
fn scan_one<R: RangeBounds<Vec<u8>> + Clone>( &self, table: &str, range: R, ) -> DbxResult<Option<(Vec<u8>, Vec<u8>)>>
Scan a single key-value pair in a range (optimized).
Auto Trait Implementations§
impl Freeze for EncryptedWosBackend
impl !RefUnwindSafe for EncryptedWosBackend
impl Send for EncryptedWosBackend
impl Sync for EncryptedWosBackend
impl Unpin for EncryptedWosBackend
impl UnsafeUnpin for EncryptedWosBackend
impl !UnwindSafe for EncryptedWosBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more