pub struct RedisServerConfig {Show 37 fields
pub port: u16,
pub bind: String,
pub protected_mode: bool,
pub tcp_backlog: Option<u32>,
pub unixsocket: Option<PathBuf>,
pub unixsocketperm: Option<u32>,
pub timeout: Option<u32>,
pub tcp_keepalive: Option<u32>,
pub tls_port: Option<u16>,
pub tls_cert_file: Option<PathBuf>,
pub tls_key_file: Option<PathBuf>,
pub tls_ca_cert_file: Option<PathBuf>,
pub tls_auth_clients: Option<bool>,
pub daemonize: bool,
pub dir: PathBuf,
pub logfile: Option<String>,
pub loglevel: LogLevel,
pub databases: Option<u32>,
pub maxmemory: Option<String>,
pub maxmemory_policy: Option<String>,
pub maxclients: Option<u32>,
pub save: bool,
pub appendonly: bool,
pub replicaof: Option<(String, u16)>,
pub masterauth: Option<String>,
pub password: Option<String>,
pub acl_file: Option<PathBuf>,
pub cluster_enabled: bool,
pub cluster_node_timeout: Option<u64>,
pub loadmodule: Vec<PathBuf>,
pub hz: Option<u32>,
pub io_threads: Option<u32>,
pub io_threads_do_reads: Option<bool>,
pub notify_keyspace_events: Option<String>,
pub extra: HashMap<String, String>,
pub redis_server_bin: String,
pub redis_cli_bin: String,
}Expand description
Full configuration snapshot for a single redis-server process.
This struct is populated by the RedisServer builder and passed to
RedisServer::start. You rarely need to construct it directly; use the
builder instead.
§Example
use redis_server_wrapper::RedisServer;
let server = RedisServer::new()
.port(6400)
.bind("127.0.0.1")
.save(false)
.start()
.await
.unwrap();
assert!(server.is_alive().await);
// Stopped automatically on Drop.Fields§
§port: u16TCP port the server listens on (default: 6379).
bind: StringIP address to bind (default: "127.0.0.1").
protected_mode: boolWhether protected mode is enabled (default: false).
tcp_backlog: Option<u32>TCP backlog queue length, if set.
unixsocket: Option<PathBuf>Unix domain socket path, if set.
unixsocketperm: Option<u32>Unix socket file permissions (e.g. 700), if set.
timeout: Option<u32>Idle client timeout in seconds (0 = disabled), if set.
tcp_keepalive: Option<u32>TCP keepalive interval in seconds, if set.
tls_port: Option<u16>TLS listening port, if set.
tls_cert_file: Option<PathBuf>Path to the TLS certificate file, if set.
tls_key_file: Option<PathBuf>Path to the TLS private key file, if set.
tls_ca_cert_file: Option<PathBuf>Path to the TLS CA certificate file, if set.
tls_auth_clients: Option<bool>Whether TLS client authentication is required, if set.
daemonize: boolWhether the server daemonizes itself (default: true).
dir: PathBufWorking directory for data files (default: a sub-directory of $TMPDIR).
logfile: Option<String>Path to the log file, if set. Defaults to redis.log inside the node directory.
loglevel: LogLevelServer log verbosity (default: LogLevel::Notice).
databases: Option<u32>Number of databases, if set (Redis default: 16).
maxmemory: Option<String>Maximum memory limit (e.g. "256mb"), if set.
maxmemory_policy: Option<String>Eviction policy when maxmemory is reached, if set.
maxclients: Option<u32>Maximum number of simultaneous client connections, if set.
save: boolWhether RDB snapshots are enabled (default: false).
appendonly: boolWhether AOF persistence is enabled (default: false).
replicaof: Option<(String, u16)>Master host and port to replicate from, if set.
masterauth: Option<String>Password for authenticating with a master, if set.
password: Option<String>requirepass password for client connections, if set.
acl_file: Option<PathBuf>Path to an ACL file, if set.
cluster_enabled: boolWhether Redis Cluster mode is enabled (default: false).
cluster_node_timeout: Option<u64>Cluster node timeout in milliseconds, if set.
loadmodule: Vec<PathBuf>List of Redis module paths to load at startup.
hz: Option<u32>Server tick frequency in Hz, if set (Redis default: 10).
io_threads: Option<u32>Number of I/O threads, if set.
io_threads_do_reads: Option<bool>Whether I/O threads also handle reads, if set.
notify_keyspace_events: Option<String>Keyspace notification event mask (e.g. "KEA"), if set.
extra: HashMap<String, String>Arbitrary key/value directives forwarded verbatim to the config file.
redis_server_bin: StringPath to the redis-server binary (default: "redis-server").
redis_cli_bin: StringPath to the redis-cli binary (default: "redis-cli").
Trait Implementations§
Source§impl Clone for RedisServerConfig
impl Clone for RedisServerConfig
Source§fn clone(&self) -> RedisServerConfig
fn clone(&self) -> RedisServerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RedisServerConfig
impl Debug for RedisServerConfig
Auto Trait Implementations§
impl Freeze for RedisServerConfig
impl RefUnwindSafe for RedisServerConfig
impl Send for RedisServerConfig
impl Sync for RedisServerConfig
impl Unpin for RedisServerConfig
impl UnsafeUnpin for RedisServerConfig
impl UnwindSafe for RedisServerConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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