pub struct ContextSourceRegistry { /* private fields */ }Expand description
Runtime-mutable registry of AsyncContextSources.
The plugin loader RCU-registers a loaded context plugin’s producer here
(drain_context); the host’s reparse-driven refresh reads a wait-free
snapshot to drive them. Named generically (not Wasm…) because it holds
native trait objects — the WASM source is one implementor among potential
natives, exactly as with GutterDecorationSourceRegistry.
Implementations§
Source§impl ContextSourceRegistry
impl ContextSourceRegistry
Sourcepub fn register(&mut self, source: Arc<dyn AsyncContextSource>)
pub fn register(&mut self, source: Arc<dyn AsyncContextSource>)
Register a producer. Idempotent per source_id: a re-register (reload)
replaces the prior producer for that id rather than accumulating a
duplicate.
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
(the teardown-report increment). No-op when absent — idempotent, per the
teardown contract.
Sourcepub fn sources(&self) -> Vec<Arc<dyn AsyncContextSource>>
pub fn sources(&self) -> Vec<Arc<dyn AsyncContextSource>>
A wait-free snapshot of the registered producers (cheap Arc clones) —
what the host’s refresh iterates.
Trait Implementations§
Source§impl Clone for ContextSourceRegistry
impl Clone for ContextSourceRegistry
Source§fn clone(&self) -> ContextSourceRegistry
fn clone(&self) -> ContextSourceRegistry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more