pub struct LoaderConfig {
pub filename: PathBuf,
pub initial: 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.
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_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
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for LoaderConfig
impl Default for LoaderConfig
Source§fn default() -> LoaderConfig
fn default() -> LoaderConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for LoaderConfig
impl !UnwindSafe for LoaderConfig
impl Freeze for LoaderConfig
impl Send for LoaderConfig
impl Sync for LoaderConfig
impl Unpin for LoaderConfig
impl UnsafeUnpin for LoaderConfig
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
Mutably borrows from an owned value. Read more