pub struct Config {Show 14 fields
pub bind_addr: String,
pub port: u16,
pub threads: usize,
pub data_path: Option<String>,
pub max_connections_per_thread: usize,
pub connection_buffer_size: usize,
pub tcp_nodelay: bool,
pub max_pipeline_depth: usize,
pub numa_aware: bool,
pub max_memory_per_shard: Option<usize>,
pub enable_ttl: bool,
pub file_size: Option<u64>,
pub log_level: String,
pub requirepass: Option<String>,
}Expand description
Server configuration
Fields§
§bind_addr: StringBind address
port: u16Port to listen on
threads: usizeNumber of worker threads
data_path: Option<String>Path to FeOx data file (None for memory-only)
max_connections_per_thread: usizeMaximum connections per thread
connection_buffer_size: usizeConnection buffer size (per connection)
tcp_nodelay: boolTCP nodelay
max_pipeline_depth: usizePipeline queue depth
numa_aware: boolEnable NUMA awareness
max_memory_per_shard: Option<usize>Maximum memory for FeOx store (per shard)
enable_ttl: boolEnable TTL support
file_size: Option<u64>File size for persistent storage (in bytes) Only used when data_path is set
log_level: StringLog level
requirepass: Option<String>Password for AUTH command (Redis-compatible) None means no authentication required
Implementations§
Source§impl Config
impl Config
Sourcepub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self>
Load configuration from a TOML file
§Example
use feox_server::Config;
let config = Config::from_file("config.toml")?;Sourcepub fn auth_required(&self) -> bool
pub fn auth_required(&self) -> bool
Check if authentication is required
Sourcepub fn check_password(&self, password: &str) -> bool
pub fn check_password(&self, password: &str) -> bool
Validate password (constant-time comparison)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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