pub struct BackendConfig {
pub name: String,
pub kind: BackendKind,
pub path: Option<PathBuf>,
pub cache_mb: Option<u32>,
pub journal_mode: Option<String>,
pub served_kinds: Option<BTreeSet<SubstrateKind>>,
pub read_only: bool,
pub wal_ceiling_bytes: Option<u64>,
pub disk_reserve_bytes: Option<u64>,
pub disk_guard_deadline_ms: Option<u64>,
}Expand description
Configuration for a named storage backend.
Corresponds to a [[backends]] entry in khive.toml.
When no [[backends]] section is present, a single implicit main backend
is synthesised from the existing --db / KHIVE_DB / default-path resolution.
All packs fall back to main when their name is absent from [packs].
cache_mb and journal_mode are parsed but rejected during validation
because per-backend tuning is not implemented.
[[backends]]
name = "main"
kind = "sqlite"
path = "~/.khive/khive.db"
read_only = falseFields§
§name: StringUnique backend name. Referenced by [packs.<name>].backend.
kind: BackendKindStorage backend kind. Defaults to sqlite.
path: Option<PathBuf>Filesystem path for sqlite kind. Tilde is expanded to $HOME.
None for memory kind (path is ignored when present).
cache_mb: Option<u32>SQLite page-cache size in MiB. Parsed but rejected as unsupported.
journal_mode: Option<String>SQLite journal mode (e.g. "wal"). Parsed but rejected as unsupported.
served_kinds: Option<BTreeSet<SubstrateKind>>Substrate kinds this backend serves.
Omission preserves conservative fan-out to this backend. An explicit
declaration is closed over SubstrateKind and must not be empty.
The backend set must cover both note and entity search.
read_only: boolOpen the backend read-only. Defaults to false.
wal_ceiling_bytes: Option<u64>WAL extent ceiling in bytes. None inherits the environment setting;
zero disables the ceiling. Read-only backends retain the configured
value for reporting but enforce no writer policy.
disk_reserve_bytes: Option<u64>SQLite disk reserve, in bytes. Zero explicitly disables the floor.
disk_guard_deadline_ms: Option<u64>Volume-guard acquisition deadline, in milliseconds (100..=10000).
Implementations§
Source§impl BackendConfig
impl BackendConfig
Sourcepub fn resolve_disk_guard(
&self,
environment: &DiskGuardEnvironment,
) -> Result<Option<EffectiveDiskGuardConfig>, ConfigError>
pub fn resolve_disk_guard( &self, environment: &DiskGuardEnvironment, ) -> Result<Option<EffectiveDiskGuardConfig>, ConfigError>
Resolve from the host’s captured environment; never sample live environment here.
Trait Implementations§
Source§impl Clone for BackendConfig
impl Clone for BackendConfig
Source§impl Debug for BackendConfig
impl Debug for BackendConfig
Source§impl<'de> Deserialize<'de> for BackendConfig
impl<'de> Deserialize<'de> for BackendConfig
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>,
Auto Trait Implementations§
impl Freeze for BackendConfig
impl RefUnwindSafe for BackendConfig
impl Send for BackendConfig
impl Sync for BackendConfig
impl Unpin for BackendConfig
impl UnsafeUnpin for BackendConfig
impl UnwindSafe for BackendConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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