pub struct DatabaseConfig {Show 15 fields
pub allow_create: bool,
pub sorted_duplicates: bool,
pub transactional: bool,
pub read_only: bool,
pub temporary: bool,
pub deferred_write: bool,
pub override_btree_comparator: bool,
pub override_duplicate_comparator: bool,
pub exclusive: bool,
pub node_max_entries: u32,
pub replicated: bool,
pub key_prefixing: bool,
pub cache_mode: CacheMode,
pub bin_delta: bool,
pub use_existing_config: bool,
}Expand description
Configuration for opening a database.
Specifies the configuration parameters used to open a database within an environment. Use the builder pattern to configure individual parameters.
Fields§
§allow_create: boolAllow creation of a new database if it doesn’t exist.
sorted_duplicates: boolWhether the database supports sorted duplicates.
transactional: boolWhether the database supports transactions.
read_only: boolOpen the database in read-only mode.
temporary: boolWhether this is a temporary database.
Temporary databases are not logged and are removed when closed.
deferred_write: boolWhether to use deferred write mode.
Deferred write databases delay writing to disk for better performance.
override_btree_comparator: boolOverride the B-tree key comparator.
Inert as of v1.6.0:
the public API has no setter for an actual comparator function,
so this flag has nothing to consume. The flag and the
ByteComparator trait are scheduled for removal in v2.0.
Setting it to true does not change the on-disk byte order.
override_duplicate_comparator: boolOverride the duplicate data comparator.
Inert as of v1.6.0 — see override_btree_comparator.
exclusive: boolWhether this database is exclusive to a single thread.
Inert as of v1.6.0: the
noxu_dbi engine has no per-database thread-affinity
enforcement; this flag is recorded but never consulted.
node_max_entries: u32Node maximum entries (0 = use default).
replicated: boolWhether this database participates in replication.
Inert as of v1.6.0: the
noxu_dbi::DatabaseConfig has no replicated field; the
replication scope is set at the env level via noxu-rep.
key_prefixing: boolEnable key prefix compression in BIN nodes.
Plumbed through to noxu_dbi::DatabaseConfig as of v1.6.0
.
cache_mode: CacheModePer-database cache eviction hint.
Inert as of v1.6.0: the per-DB hint is not yet honoured by the evictor; the env-level cache mode is.
bin_delta: boolWrite BIN-deltas to the log instead of full BINs (space optimization).
Inert as of v1.6.0: the engine always emits BIN-deltas where applicable.
use_existing_config: boolWhen true, opening an existing database reuses its stored config rather than applying this config.
Inert as of v1.6.0: the engine does not yet persist per-DB config across runs in a way that can be selectively re-applied.
Implementations§
Source§impl DatabaseConfig
impl DatabaseConfig
Sourcepub fn set_allow_create(&mut self, allow_create: bool) -> &mut Self
pub fn set_allow_create(&mut self, allow_create: bool) -> &mut Self
Sets whether to allow creation of a new database.
Sourcepub fn set_sorted_duplicates(&mut self, sorted_duplicates: bool) -> &mut Self
pub fn set_sorted_duplicates(&mut self, sorted_duplicates: bool) -> &mut Self
Sets whether the database supports sorted duplicates.
Sourcepub fn set_transactional(&mut self, transactional: bool) -> &mut Self
pub fn set_transactional(&mut self, transactional: bool) -> &mut Self
Sets whether the database supports transactions.
Sourcepub fn set_read_only(&mut self, read_only: bool) -> &mut Self
pub fn set_read_only(&mut self, read_only: bool) -> &mut Self
Sets whether the database is read-only.
Sourcepub fn set_temporary(&mut self, temporary: bool) -> &mut Self
pub fn set_temporary(&mut self, temporary: bool) -> &mut Self
Sets whether this is a temporary database.
Sourcepub fn set_deferred_write(&mut self, deferred_write: bool) -> &mut Self
pub fn set_deferred_write(&mut self, deferred_write: bool) -> &mut Self
Sets whether to use deferred write mode.
Sourcepub fn set_override_btree_comparator(
&mut self,
override_btree_comparator: bool,
) -> &mut Self
pub fn set_override_btree_comparator( &mut self, override_btree_comparator: bool, ) -> &mut Self
Sets whether to override the B-tree comparator.
Sourcepub fn set_override_duplicate_comparator(
&mut self,
override_duplicate_comparator: bool,
) -> &mut Self
pub fn set_override_duplicate_comparator( &mut self, override_duplicate_comparator: bool, ) -> &mut Self
Sets whether to override the duplicate comparator.
Sourcepub fn set_exclusive(&mut self, exclusive: bool) -> &mut Self
pub fn set_exclusive(&mut self, exclusive: bool) -> &mut Self
Sets whether the database is exclusive.
Sourcepub fn set_node_max_entries(&mut self, node_max_entries: u32) -> &mut Self
pub fn set_node_max_entries(&mut self, node_max_entries: u32) -> &mut Self
Sets the node maximum entries.
Sourcepub fn with_allow_create(self, allow_create: bool) -> Self
pub fn with_allow_create(self, allow_create: bool) -> Self
Builder-style method to set allow_create.
Sourcepub fn with_sorted_duplicates(self, sorted_duplicates: bool) -> Self
pub fn with_sorted_duplicates(self, sorted_duplicates: bool) -> Self
Builder-style method to set sorted_duplicates.
Sourcepub fn with_transactional(self, transactional: bool) -> Self
pub fn with_transactional(self, transactional: bool) -> Self
Builder-style method to set transactional.
Sourcepub fn with_read_only(self, read_only: bool) -> Self
pub fn with_read_only(self, read_only: bool) -> Self
Builder-style method to set read_only.
Sourcepub fn with_temporary(self, temporary: bool) -> Self
pub fn with_temporary(self, temporary: bool) -> Self
Builder-style method to set temporary.
Sourcepub fn with_deferred_write(self, deferred_write: bool) -> Self
pub fn with_deferred_write(self, deferred_write: bool) -> Self
Builder-style method to set deferred_write.
Sourcepub fn set_replicated(&mut self, replicated: bool) -> &mut Self
pub fn set_replicated(&mut self, replicated: bool) -> &mut Self
Sets whether this database participates in replication.
Sourcepub fn with_replicated(self, replicated: bool) -> Self
pub fn with_replicated(self, replicated: bool) -> Self
Builder-style method to set replicated.
Sourcepub fn set_key_prefixing(&mut self, key_prefixing: bool) -> &mut Self
pub fn set_key_prefixing(&mut self, key_prefixing: bool) -> &mut Self
Sets whether key prefix compression is enabled.
Sourcepub fn with_key_prefixing(self, key_prefixing: bool) -> Self
pub fn with_key_prefixing(self, key_prefixing: bool) -> Self
Builder-style method to set key_prefixing.
Sourcepub fn set_cache_mode(&mut self, cache_mode: CacheMode) -> &mut Self
pub fn set_cache_mode(&mut self, cache_mode: CacheMode) -> &mut Self
Sets the per-database cache eviction mode.
Sourcepub fn with_cache_mode(self, cache_mode: CacheMode) -> Self
pub fn with_cache_mode(self, cache_mode: CacheMode) -> Self
Builder-style method to set cache_mode.
Sourcepub fn set_bin_delta(&mut self, bin_delta: bool) -> &mut Self
pub fn set_bin_delta(&mut self, bin_delta: bool) -> &mut Self
Sets whether BIN-deltas are written to the log.
Sourcepub fn with_bin_delta(self, bin_delta: bool) -> Self
pub fn with_bin_delta(self, bin_delta: bool) -> Self
Builder-style method to set bin_delta.
Sourcepub fn set_use_existing_config(&mut self, v: bool) -> &mut Self
pub fn set_use_existing_config(&mut self, v: bool) -> &mut Self
Sets whether to reuse existing config when opening an existing database.
Sourcepub fn with_use_existing_config(self, v: bool) -> Self
pub fn with_use_existing_config(self, v: bool) -> Self
Builder-style method to set use_existing_config.
Trait Implementations§
Source§impl Clone for DatabaseConfig
impl Clone for DatabaseConfig
Source§fn clone(&self) -> DatabaseConfig
fn clone(&self) -> DatabaseConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DatabaseConfig
impl Debug for DatabaseConfig
Source§impl Default for DatabaseConfig
impl Default for DatabaseConfig
impl Eq for DatabaseConfig
Source§impl PartialEq for DatabaseConfig
impl PartialEq for DatabaseConfig
Source§fn eq(&self, other: &DatabaseConfig) -> bool
fn eq(&self, other: &DatabaseConfig) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DatabaseConfig
Auto Trait Implementations§
impl Freeze for DatabaseConfig
impl RefUnwindSafe for DatabaseConfig
impl Send for DatabaseConfig
impl Sync for DatabaseConfig
impl Unpin for DatabaseConfig
impl UnsafeUnpin for DatabaseConfig
impl UnwindSafe for DatabaseConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.