pub struct Registry { /* private fields */ }Expand description
Every plugin this binary knows how to build.
Implementations§
Source§impl Registry
impl Registry
pub fn new() -> Self
pub fn register(&mut self, factory: impl PluginFactory) -> &mut Self
pub fn register_arc(&mut self, factory: Arc<dyn PluginFactory>) -> &mut Self
pub fn get(&self, name: &str) -> Option<&Arc<dyn PluginFactory>>
pub fn iter(&self) -> impl Iterator<Item = &Arc<dyn PluginFactory>>
Sourcepub fn names(&self) -> impl Iterator<Item = &str>
pub fn names(&self) -> impl Iterator<Item = &str>
The names plugins call themselves, not the normalized keys they are
stored under: these are shown to people, in --list-plugins and in the
suggestions on an unknown plugin.
Sourcepub fn build(
&self,
specs: &[PluginSpec],
meta: &PipelineMeta,
host: &mut dyn HostBuilder,
) -> Result<Chain>
pub fn build( &self, specs: &[PluginSpec], meta: &PipelineMeta, host: &mut dyn HostBuilder, ) -> Result<Chain>
Build the chain for one direction.
Entries that do not apply to meta.direction are skipped. On the
sink-to-source path the survivors are mirrored, so a declaration
[a, b] nests as a(b(payload)) in both directions.
Sourcepub fn build_pair(
&self,
specs: &[PluginSpec],
source: &str,
sink: &str,
peer: Option<&str>,
host: &mut dyn HostBuilder,
) -> Result<(Chain, Chain)>
pub fn build_pair( &self, specs: &[PluginSpec], source: &str, sink: &str, peer: Option<&str>, host: &mut dyn HostBuilder, ) -> Result<(Chain, Chain)>
Build both directions at once. Returns (source_to_sink, sink_to_source).
Both share one host, which is how identical side-channel targets end
up sharing a single writer.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Registry
impl !UnwindSafe for Registry
impl Freeze for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl UnsafeUnpin for Registry
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