pub struct DocumentDiscoveryPlugin;Expand description
Plugin that auto-discovers document files from configured directories.
Scans directories specified in option "documents" for files matching
the pattern: {Account}/YYYY-MM-DD.description.*
For example: documents/Assets/Bank/Checking/2024-01-15.statement.pdf
generates: 2024-01-15 document Assets:Bank:Checking "documents/Assets/Bank/Checking/2024-01-15.statement.pdf"
§Configuration
The plugin reads its per-load context (resolved document directories
and the ledger’s base directory for relative-path normalization) from
PluginInput::config as a JSON object:
{"base_dir": "/path/to/ledger", "directories": ["/abs/path/docs"]}The loader constructs this config when populating the synth pass; if
config is None or directories is empty, the plugin returns a
no-op (every input directive is kept, nothing synthesized). If config
is present but malformed JSON, every input directive is still kept and
a PluginError::error is added to the output errors — the plugin
never silently drops directives on bad config. This lets the plugin
sit in the registry as a static instance and be dispatched through
the normal synth-pass machinery.
§Security
- Symlinks are skipped to prevent infinite recursion from symlink cycles
- Maximum recursion depth is enforced to prevent denial-of-service from deeply nested directories
Trait Implementations§
Source§impl NativePlugin for DocumentDiscoveryPlugin
impl NativePlugin for DocumentDiscoveryPlugin
Source§fn name(&self) -> &'static str
fn name(&self) -> &'static str
"implicit_prices", not the
fully-qualified module path).Source§fn description(&self) -> &'static str
fn description(&self) -> &'static str
--help and similar UI surfaces.Source§fn process(&self, input: PluginInput) -> PluginOutput
fn process(&self, input: PluginInput) -> PluginOutput
impl SynthPlugin for DocumentDiscoveryPlugin
Synthesizes Document directives that downstream consumers expect
alongside user-written ones — runs in the synth pass so the early
validator sees them.
Auto Trait Implementations§
impl Freeze for DocumentDiscoveryPlugin
impl RefUnwindSafe for DocumentDiscoveryPlugin
impl Send for DocumentDiscoveryPlugin
impl Sync for DocumentDiscoveryPlugin
impl Unpin for DocumentDiscoveryPlugin
impl UnsafeUnpin for DocumentDiscoveryPlugin
impl UnwindSafe for DocumentDiscoveryPlugin
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.