pub struct BlockStoreConfig {
pub path: PathBuf,
pub cache_size: usize,
}Expand description
Block store configuration
Fields§
§path: PathBufPath to the database directory
cache_size: usizeCache size in bytes
Implementations§
Source§impl BlockStoreConfig
impl BlockStoreConfig
Sourcepub fn development() -> Self
pub fn development() -> Self
Create a configuration optimized for development
- Small cache (50MB)
- Stored in /tmp for easy cleanup
Sourcepub fn production(path: PathBuf) -> Self
pub fn production(path: PathBuf) -> Self
Create a configuration optimized for production
- Large cache (500MB)
- Stored in standard location
Sourcepub fn embedded(path: PathBuf) -> Self
pub fn embedded(path: PathBuf) -> Self
Create a configuration optimized for embedded devices
- Minimal cache (10MB)
- Configurable path
Sourcepub fn testing() -> Self
pub fn testing() -> Self
Create a configuration optimized for testing
- Minimal cache (5MB)
- Temporary directory with unique name
Sourcepub fn with_cache_mb(self, cache_mb: usize) -> Self
pub fn with_cache_mb(self, cache_mb: usize) -> Self
Builder: Set the cache size in MB
Sourcepub fn with_cache_bytes(self, cache_bytes: usize) -> Self
pub fn with_cache_bytes(self, cache_bytes: usize) -> Self
Builder: Set the cache size in bytes
Trait Implementations§
Source§impl Clone for BlockStoreConfig
impl Clone for BlockStoreConfig
Source§fn clone(&self) -> BlockStoreConfig
fn clone(&self) -> BlockStoreConfig
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 Debug for BlockStoreConfig
impl Debug for BlockStoreConfig
Auto Trait Implementations§
impl Freeze for BlockStoreConfig
impl RefUnwindSafe for BlockStoreConfig
impl Send for BlockStoreConfig
impl Sync for BlockStoreConfig
impl Unpin for BlockStoreConfig
impl UnwindSafe for BlockStoreConfig
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<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