pub struct SingleNodeEngine { /* private fields */ }Expand description
Single-node key-value engine with worker threads and automatic compaction.
Implementations§
Source§impl SingleNodeEngine
impl SingleNodeEngine
Sourcepub fn with_config(config: StoreConfig) -> Result<Self>
pub fn with_config(config: StoreConfig) -> Result<Self>
Creates a new engine with the specified configuration.
Sourcepub fn put(&self, key: Vec<u8>, value: Vec<u8>) -> Result<ApplyOutcome>
pub fn put(&self, key: Vec<u8>, value: Vec<u8>) -> Result<ApplyOutcome>
Inserts or updates a key-value pair.
Sourcepub fn submit_batch<I>(&self, commands: I) -> Result<Vec<ApplyOutcome>>where
I: IntoIterator<Item = Command>,
pub fn submit_batch<I>(&self, commands: I) -> Result<Vec<ApplyOutcome>>where
I: IntoIterator<Item = Command>,
Submits a batch of commands for execution.
Sourcepub fn read_with<F, R>(&self, reader: F) -> R
pub fn read_with<F, R>(&self, reader: F) -> R
Executes a read operation with a consistent snapshot of the state.
Sourcepub fn run_compaction_now(&self) -> Result<()>
pub fn run_compaction_now(&self) -> Result<()>
Triggers an immediate compaction run.
Sourcepub fn get_prefix(&self, prefix: &[u8]) -> Result<Vec<(Vec<u8>, Vec<u8>)>>
pub fn get_prefix(&self, prefix: &[u8]) -> Result<Vec<(Vec<u8>, Vec<u8>)>>
Retrieves all key-value pairs with the given prefix.
Sourcepub fn into_argon2_hasher_aes_gcm_auth_service(
self,
master_key: [u8; 32],
) -> (Arc<SingleNodeEngine>, AuthService<Arc<SingleNodeEngine>, Argon2SecretHasher, AesGcmEncryptor>)
pub fn into_argon2_hasher_aes_gcm_auth_service( self, master_key: [u8; 32], ) -> (Arc<SingleNodeEngine>, AuthService<Arc<SingleNodeEngine>, Argon2SecretHasher, AesGcmEncryptor>)
Wraps the engine in an Arc and constructs an AuthService configured with Argon2 hashing and AES-GCM encryption.
Trait Implementations§
Source§impl Debug for SingleNodeEngine
impl Debug for SingleNodeEngine
Source§impl Drop for SingleNodeEngine
impl Drop for SingleNodeEngine
Source§impl KvEngine for SingleNodeEngine
impl KvEngine for SingleNodeEngine
Source§fn submit(&self, command: Command) -> Result<ApplyOutcome>
fn submit(&self, command: Command) -> Result<ApplyOutcome>
Submits a single command for execution.
Source§fn submit_batch<I>(&self, commands: I) -> Result<Vec<ApplyOutcome>>where
I: IntoIterator<Item = Command>,
fn submit_batch<I>(&self, commands: I) -> Result<Vec<ApplyOutcome>>where
I: IntoIterator<Item = Command>,
Submits a batch of commands for execution.
Source§impl SnapshotEngine for SingleNodeEngine
impl SnapshotEngine for SingleNodeEngine
Source§fn snapshot_state(&self) -> KvState
fn snapshot_state(&self) -> KvState
Returns a snapshot of the current key-value state.
Source§fn latest_version(&self) -> u64
fn latest_version(&self) -> u64
Returns the latest version number in the store.
Auto Trait Implementations§
impl Freeze for SingleNodeEngine
impl !RefUnwindSafe for SingleNodeEngine
impl Send for SingleNodeEngine
impl Sync for SingleNodeEngine
impl Unpin for SingleNodeEngine
impl !UnwindSafe for SingleNodeEngine
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