pub struct DefaultConfig;Expand description
The default configuration for the QBICE engine.
This configuration provides sensible defaults suitable for most applications. It uses:
- Storage: 16-byte inline storage (suitable for small to medium keys)
- Database:
RocksDBfor persistent storage - Stable Hasher: SipHash-128 for deterministic query identification
- Standard Hasher:
FxHashfor fast internal hash maps - Cache Capacity: 262,144 entries (2^18)
- Writer Threads: 2 background writers
§When to Use
DefaultConfig is appropriate for:
- Quick prototyping and development
- Applications with typical query sizes and workload patterns
- Projects that don’t require specialized performance tuning
§When to Customize
Consider implementing a custom Config if you need:
- Different inline storage sizes for larger/smaller query keys
- Alternative database backends
- Tuned cache capacities for your workload
- Custom thread pool configurations
§Example
ⓘ
use std::sync::Arc;
use qbice::{DefaultConfig, Engine, serialize::Plugin};
use qbice::stable_hash::{SeededStableHasherBuilder, Sip128Hasher};
use qbice::storage::kv_database::rocksdb::RocksDB;
let temp_dir = tempfile::tempdir()?;
// Create an engine with default configuration
let engine = Engine::<DefaultConfig>::new_with(
Plugin::default(),
RocksDB::factory(temp_dir.path()),
SeededStableHasherBuilder::<Sip128Hasher>::new(0),
)?;
// Ready to use!Trait Implementations§
Source§impl Clone for DefaultConfig
impl Clone for DefaultConfig
Source§fn clone(&self) -> DefaultConfig
fn clone(&self) -> DefaultConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Config for DefaultConfig
Available on crate feature default_config only.
impl Config for DefaultConfig
Available on crate feature
default_config only.Source§type BuildStableHasher = SeededStableHasherBuilder<SipHasher>
type BuildStableHasher = SeededStableHasherBuilder<SipHasher>
The stable hasher builder used by the engine.
Source§type BuildHasher = BuildHasherDefault<FxHasher>
type BuildHasher = BuildHasherDefault<FxHasher>
The standard hasher builder used by the engine.
Source§fn cache_entry_capacity() -> usize
fn cache_entry_capacity() -> usize
The maximum number of query entries to keep in the in-memory cache. Read more
Source§fn background_writer_thread_count() -> usize
fn background_writer_thread_count() -> usize
The number of background threads for writing data to the database. Read more
Source§fn rayon_thread_pool_builder() -> ThreadPoolBuilder
fn rayon_thread_pool_builder() -> ThreadPoolBuilder
Creates a Rayon thread pool builder for parallel query execution. Read more
Source§impl Debug for DefaultConfig
impl Debug for DefaultConfig
Source§impl Default for DefaultConfig
impl Default for DefaultConfig
Source§fn default() -> DefaultConfig
fn default() -> DefaultConfig
Returns the “default value” for a type. Read more
Source§impl Hash for DefaultConfig
impl Hash for DefaultConfig
Source§impl Identifiable for DefaultConfig
impl Identifiable for DefaultConfig
Source§const STABLE_TYPE_ID: StableTypeID
const STABLE_TYPE_ID: StableTypeID
Returns the stable type ID of the type. Read more
Source§impl Ord for DefaultConfig
impl Ord for DefaultConfig
Source§fn cmp(&self, other: &DefaultConfig) -> Ordering
fn cmp(&self, other: &DefaultConfig) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for DefaultConfig
impl PartialEq for DefaultConfig
Source§impl PartialOrd for DefaultConfig
impl PartialOrd for DefaultConfig
impl Copy for DefaultConfig
impl Eq for DefaultConfig
impl StructuralPartialEq for DefaultConfig
Auto Trait Implementations§
impl Freeze for DefaultConfig
impl RefUnwindSafe for DefaultConfig
impl Send for DefaultConfig
impl Sync for DefaultConfig
impl Unpin for DefaultConfig
impl UnwindSafe for DefaultConfig
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> 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§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