pub struct LoaderConfig {
pub filename: PathBuf,
pub initial: Option<Document>,
pub document: Option<Document>,
pub registry: Option<PluginRegistry>,
pub write_debounce: Option<Duration>,
}Expand description
Where the loader reads and writes its entry file.
Fields§
§filename: PathBufPath to the entry config file (.yml/.yaml/.json).
initial: Option<Document>Document written on first run when the file does not exist yet.
document: Option<Document>Document composed from instead of reading the entry file. When set,
the file is never read at boot or reload — it only receives
write-backs (self-disable persistence, id materialization). Takes
precedence over LoaderConfig::initial, whose boot-time write it
also suppresses.
registry: Option<PluginRegistry>Plugin registry used to resolve entry names; defaults to a fresh
PluginRegistry with only the group builtin.
write_debounce: Option<Duration>Debounce window for coalesced config writes; None (default)
persists every write synchronously.
Implementations§
Source§impl LoaderConfig
impl LoaderConfig
Sourcepub fn with_initial(self, initial: Document) -> Self
pub fn with_initial(self, initial: Document) -> Self
Provide the document written when the file is missing.
Sourcepub fn with_document(self, document: Document) -> Self
pub fn with_document(self, document: Document) -> Self
Compose from the given document instead of reading the entry file.
The loader treats the file as a pure write-back draft: nothing is
read from or written to it at boot, and reloads recompose from this
document (import files are still read). This is the composition
source profile boot needs — the naive “compose → write draft →
open” races between concurrent boots on one profile (another
process’s draft could land between this one’s write and read) and
requires a writable directory. Replace the source at runtime with
Loader::update.
Sourcepub fn with_registry(self, registry: PluginRegistry) -> Self
pub fn with_registry(self, registry: PluginRegistry) -> Self
Provide the plugin registry entries resolve against.
Sourcepub fn with_write_debounce(self, delay: Duration) -> Self
pub fn with_write_debounce(self, delay: Duration) -> Self
Coalesce config writes: rapid write-backs merge and land once after this much quiet time.
Trait Implementations§
Source§impl Clone for LoaderConfig
impl Clone for LoaderConfig
Source§fn clone(&self) -> LoaderConfig
fn clone(&self) -> LoaderConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more