pub struct ClientConfig {
pub socket_path: PathBuf,
pub port_path: PathBuf,
pub project_root: String,
pub expected_schema_version: u32,
pub connect_timeout: Duration,
pub poll_interval: Duration,
pub spawn: Spawner,
pub transport: Transport,
}Expand description
Configuration for a Client.
Fields§
§socket_path: PathBufUnix domain socket the daemon listens on
(~/.kindling/kindling.sock by default). Used when Self::transport
is Transport::Uds.
port_path: PathBufFile the daemon publishes its TCP port to
(~/.kindling/kindling.port by default). Read when Self::transport
is Transport::Tcp.
project_root: StringProject root string, sent as the X-Kindling-Project header on every
data endpoint. The daemon hashes it to route to a per-project DB.
Defaults to the current working directory.
expected_schema_version: u32Schema version the client requires the daemon to report from
/v1/health. Defaults to EXPECTED_SCHEMA_VERSION.
connect_timeout: DurationTotal budget for the auto-spawn connect poll (connect + spawn + retry). Defaults to 1 second.
poll_interval: DurationInterval between socket-connect attempts while polling for the daemon. Defaults to 10ms.
spawn: SpawnerHow to start the daemon when it is not running. Defaults to the real
kindling serve --daemonize binary.
transport: TransportTransport to reach the daemon. Defaults to Transport::default (UDS
on Unix, TCP on Windows).
Implementations§
Source§impl ClientConfig
impl ClientConfig
Sourcepub fn defaults() -> Result<Self>
pub fn defaults() -> Result<Self>
Build a default config: ~/.kindling/kindling.sock, project root from
the current directory, the compiled schema version, a 1s connect budget,
a 10ms poll interval, and the real binary spawner.
Errors only if neither the kindling home nor the current directory can be determined.
Trait Implementations§
Source§impl Clone for ClientConfig
impl Clone for ClientConfig
Source§fn clone(&self) -> ClientConfig
fn clone(&self) -> ClientConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more