pub struct Config {
pub wal: Config,
pub log_cache_max_items: Option<usize>,
pub log_cache_capacity: Option<usize>,
}Expand description
Configuration for Raft-log.
This struct holds various configuration parameters for the Raft-log, including WAL storage and cache settings.
Optional parameters are Option<T> in this struct, and default values is
evaluated when a getter method is called.
Fields§
§wal: ConfigWAL storage configuration.
log_cache_max_items: Option<usize>Maximum number of items to keep in the log cache
log_cache_capacity: Option<usize>Maximum capacity of the log cache in bytes
Implementations§
Source§impl Config
impl Config
Sourcepub fn new(dir: impl ToString) -> Self
pub fn new(dir: impl ToString) -> Self
Creates a new Config with the specified directory and default values for other fields
Sourcepub fn log_cache_max_items(&self) -> usize
pub fn log_cache_max_items(&self) -> usize
Returns the maximum number of items in log cache (defaults to 100,000)
Sourcepub fn log_cache_capacity(&self) -> usize
pub fn log_cache_capacity(&self) -> usize
Returns the maximum capacity of log cache in bytes (defaults to 1GB)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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