pub struct PluginRegistry { /* private fields */ }Expand description
Explicit plugin registry.
Implementations§
Source§impl PluginRegistry
impl PluginRegistry
Sourcepub const fn new() -> PluginRegistry
pub const fn new() -> PluginRegistry
Creates an empty registry.
Sourcepub fn register_plugin<P>(&mut self, plugin: &P)
pub fn register_plugin<P>(&mut self, plugin: &P)
Registers all extension points provided by plugin.
Sourcepub fn plugin_version(&self, name: &str) -> Option<&str>
pub fn plugin_version(&self, name: &str) -> Option<&str>
Returns the registered version for a plugin name.
Sourcepub fn plugin_names(&self) -> impl Iterator<Item = &str>
pub fn plugin_names(&self) -> impl Iterator<Item = &str>
Iterates registered plugin names in deterministic order.
Sourcepub fn register_renderer(
&mut self,
name: impl Into<String>,
factory: Box<dyn RendererFactory>,
) -> Option<Box<dyn RendererFactory>>
pub fn register_renderer( &mut self, name: impl Into<String>, factory: Box<dyn RendererFactory>, ) -> Option<Box<dyn RendererFactory>>
Registers or replaces a renderer factory by name.
Sourcepub fn register_encoder(
&mut self,
name: impl Into<String>,
factory: Box<dyn EncoderFactory>,
) -> Option<Box<dyn EncoderFactory>>
pub fn register_encoder( &mut self, name: impl Into<String>, factory: Box<dyn EncoderFactory>, ) -> Option<Box<dyn EncoderFactory>>
Registers or replaces an encoder factory by name.
Sourcepub fn register_postprocessor(&mut self, postprocessor: Box<dyn PostProcessor>)
pub fn register_postprocessor(&mut self, postprocessor: Box<dyn PostProcessor>)
Appends a postprocessor to the registry.
Sourcepub fn renderer(&self, name: &str) -> Option<&dyn RendererFactory>
pub fn renderer(&self, name: &str) -> Option<&dyn RendererFactory>
Returns a renderer factory by name.
Sourcepub fn build_renderer(
&self,
name: &str,
config: &RenderConfig,
) -> Result<Box<dyn DynRenderer>, PluginError>
pub fn build_renderer( &self, name: &str, config: &RenderConfig, ) -> Result<Box<dyn DynRenderer>, PluginError>
Builds a renderer by name.
§Errors
Returns PluginError::RendererNotFound when no renderer factory is
registered with name.
Sourcepub fn encoder(&self, name: &str) -> Option<&dyn EncoderFactory>
pub fn encoder(&self, name: &str) -> Option<&dyn EncoderFactory>
Returns an encoder factory by name.
Sourcepub fn build_encoder(
&self,
name: &str,
config: &EncodeConfig,
) -> Result<Box<dyn DynEncoder>, PluginError>
pub fn build_encoder( &self, name: &str, config: &EncodeConfig, ) -> Result<Box<dyn DynEncoder>, PluginError>
Builds an encoder by name.
§Errors
Returns PluginError::EncoderNotFound when no encoder factory is
registered with name.
Sourcepub fn postprocessors(&self) -> &[Box<dyn PostProcessor>]
pub fn postprocessors(&self) -> &[Box<dyn PostProcessor>]
Returns all postprocessors in registration order.
Sourcepub fn process_modules(
&self,
modules: &mut dyn ModuleStorage,
) -> Result<(), PluginError>
pub fn process_modules( &self, modules: &mut dyn ModuleStorage, ) -> Result<(), PluginError>
Applies all registered postprocessors in registration order.
§Errors
Returns the first PluginError reported by a postprocessor.
Sourcepub fn renderer_names(&self) -> impl Iterator<Item = &str>
pub fn renderer_names(&self) -> impl Iterator<Item = &str>
Iterates renderer names in deterministic order.
Sourcepub fn encoder_names(&self) -> impl Iterator<Item = &str>
pub fn encoder_names(&self) -> impl Iterator<Item = &str>
Iterates encoder names in deterministic order.
Trait Implementations§
Source§impl Default for PluginRegistry
impl Default for PluginRegistry
Source§fn default() -> PluginRegistry
fn default() -> PluginRegistry
Auto Trait Implementations§
impl !RefUnwindSafe for PluginRegistry
impl !Send for PluginRegistry
impl !Sync for PluginRegistry
impl !UnwindSafe for PluginRegistry
impl Freeze for PluginRegistry
impl Unpin for PluginRegistry
impl UnsafeUnpin for PluginRegistry
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
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 more