pub struct ServerConfig {
pub socket_path: PathBuf,
pub kindling_home: PathBuf,
pub pid_path: PathBuf,
pub port_path: PathBuf,
pub idle_timeout: Duration,
pub transport: Transport,
}Expand description
Runtime configuration for serve.
Construct via ServerConfig::new for the default home-relative paths, or
build the struct directly (tests inject a temp kindling_home, a unique
socket_path, a unique pid_path, and a short idle_timeout).
Fields§
§socket_path: PathBufUnix domain socket to bind (~/.kindling/kindling.sock by default).
kindling_home: PathBufRoot of per-project databases (~/.kindling by default). Each request’s
X-Kindling-Project header routes to kindling_home/projects/<hash>/….
pid_path: PathBufPID file written on startup (~/.kindling/kindling.pid by default).
port_path: PathBufFile the TCP port is published to when Self::transport is
Transport::Tcp (~/.kindling/kindling.port by default). Written
after binding the ephemeral loopback port; removed on shutdown. Unused
for the UDS transport.
idle_timeout: DurationShut down after this much idle time (no in-flight and no recent
requests). Defaults to DEFAULT_IDLE_TIMEOUT.
transport: TransportTransport to bind. Defaults to Transport::default (UDS on Unix, TCP
on Windows).
Implementations§
Source§impl ServerConfig
impl ServerConfig
Sourcepub fn new(kindling_home: PathBuf) -> Self
pub fn new(kindling_home: PathBuf) -> Self
Build a config rooted at kindling_home with conventional file names.
Sourcepub fn from_default_home() -> Option<Self>
pub fn from_default_home() -> Option<Self>
Build a config from the default kindling home (~/.kindling).
Returns None when no home directory can be determined (mirrors
kindling_store::default_kindling_home).
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more