Skip to main content

ClientConfig

Struct ClientConfig 

Source
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: PathBuf

Unix domain socket the daemon listens on (~/.kindling/kindling.sock by default). Used when Self::transport is Transport::Uds.

§port_path: PathBuf

File the daemon publishes its TCP port to (~/.kindling/kindling.port by default). Read when Self::transport is Transport::Tcp.

§project_root: String

Project 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: u32

Schema version the client requires the daemon to report from /v1/health. Defaults to EXPECTED_SCHEMA_VERSION.

§connect_timeout: Duration

Total budget for the auto-spawn connect poll (connect + spawn + retry). Defaults to 1 second.

§poll_interval: Duration

Interval between socket-connect attempts while polling for the daemon. Defaults to 10ms.

§spawn: Spawner

How to start the daemon when it is not running. Defaults to the real kindling serve --daemonize binary.

§transport: Transport

Transport to reach the daemon. Defaults to Transport::default (UDS on Unix, TCP on Windows).

Implementations§

Source§

impl ClientConfig

Source

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

Source§

fn clone(&self) -> ClientConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ClientConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.