pub struct ScannedExcerptSourceRegistry { /* private fields */ }Expand description
Runtime-mutable registry of ScannedExcerptSources.
Implementations§
Source§impl ScannedExcerptSourceRegistry
impl ScannedExcerptSourceRegistry
Sourcepub fn register(&mut self, source: Arc<dyn ScannedExcerptSource>)
pub fn register(&mut self, source: Arc<dyn ScannedExcerptSource>)
Register a producer. Idempotent per source_id: a re-register
(reload) replaces rather than accumulating a duplicate — otherwise
every :plugin-reload would double every row in the agenda.
Sourcepub fn unregister(&mut self, source_id: u64) -> usize
pub fn unregister(&mut self, source_id: u64) -> usize
Unregister every producer for source_id; returns the count removed.
No-op when absent, per the teardown contract.
Sourcepub fn sources(&self) -> Vec<Arc<dyn ScannedExcerptSource>>
pub fn sources(&self) -> Vec<Arc<dyn ScannedExcerptSource>>
A snapshot of the registered producers.
Sourcepub fn view_modes(&self) -> Vec<String>
pub fn view_modes(&self) -> Vec<String>
Every minor mode a registered source wants on the agenda view.
Deduplicated, and returned for EVERY registered source rather than only the ones that contributed rows: a source’s chords must be present before the scan finishes, and a mode whose actions no-op off its own rows is harmless where a mode that arrives late is a key that works on the second try.
Sourcepub fn claiming(&self, path: &Path) -> Vec<Arc<dyn ScannedExcerptSource>>
pub fn claiming(&self, path: &Path) -> Vec<Arc<dyn ScannedExcerptSource>>
Every source claiming path’s extension.
The walk asks this per file. Returning the matching sources rather
than a bool means a file claimed by two producers is offered to both,
which is the honest answer when a markdown TODO scanner and a
checklist scanner both want .md.
Trait Implementations§
Source§impl Clone for ScannedExcerptSourceRegistry
impl Clone for ScannedExcerptSourceRegistry
Source§fn clone(&self) -> ScannedExcerptSourceRegistry
fn clone(&self) -> ScannedExcerptSourceRegistry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more