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: String
Bind address
port: u16
Port to listen on
threads: usize
Number of worker threads
data_path: Option<String>
Path to FeOx data file (None for memory-only)
max_connections_per_thread: usize
Maximum connections per thread
connection_buffer_size: usize
Connection buffer size (per connection)
tcp_nodelay: bool
TCP nodelay
max_pipeline_depth: usize
Pipeline queue depth
numa_aware: bool
Enable NUMA awareness
max_memory_per_shard: Option<usize>
Maximum memory for FeOx store (per shard)
enable_ttl: bool
Enable TTL support
file_size: Option<u64>
File size for persistent storage (in bytes) Only used when data_path is set
log_level: String
Log 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 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