pub struct CompilationParserFactories { /* private fields */ }Expand description
The registered set of plugin parser factories, in registration order.
Clone so the handle below can RCU it: clone → mutate → store.
Cloning is cheap — the factories are Arc-shared.
Implementations§
Source§impl CompilationParserFactories
impl CompilationParserFactories
Sourcepub fn register(&mut self, factory: Arc<dyn CompilationParserFactory>)
pub fn register(&mut self, factory: Arc<dyn CompilationParserFactory>)
Append a factory. Order is preserved and becomes the order the minted parsers see each line in.
Sourcepub fn unregister_plugin(&mut self, plugin_id: u64) -> usize
pub fn unregister_plugin(&mut self, plugin_id: u64) -> usize
Drop every factory contributed by plugin_id, returning how
many were removed. Idempotent: a second call reports zero, which
is what the teardown contract requires of a double-unload.
Sourcepub fn create_all(&self) -> Vec<Box<dyn CompilationParser>>
pub fn create_all(&self) -> Vec<Box<dyn CompilationParser>>
Mint one parser per factory, skipping any that failed to instantiate.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether no factory is registered — the overwhelmingly common case, and the one a run checks to skip the snapshot entirely.
Sourcepub fn new_handle() -> CompilationParserFactoriesHandle
pub fn new_handle() -> CompilationParserFactoriesHandle
A fresh empty CompilationParserFactoriesHandle.
Exists so consumers — the plugin host’s teardown tests, the
loader’s harness — do not each have to name arc_swap just to
build the handle this crate defines.
Trait Implementations§
Source§impl Clone for CompilationParserFactories
impl Clone for CompilationParserFactories
Source§fn clone(&self) -> CompilationParserFactories
fn clone(&self) -> CompilationParserFactories
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more