PluginRegistry

Struct PluginRegistry 

Source
pub struct PluginRegistry { /* private fields */ }
Expand description

Plugin registry for managing multiple plugins

Implementations§

Source§

impl PluginRegistry

Source

pub fn new() -> Self

Creates a new plugin registry

Source

pub fn register_processor(&mut self, processor: Box<dyn BlockProcessor>)

Registers a block processor

Source

pub fn register_validator(&mut self, validator: Box<dyn BlockValidator>)

Registers a block validator

Source

pub fn register_transformer(&mut self, transformer: Box<dyn ContentTransformer>)

Registers a content transformer

Source

pub fn process_block(&self, block: &mut Block) -> Result<()>

Processes a block through all registered processors

Source

pub fn process_document(&self, document: &mut Document) -> Result<()>

Processes a document through all registered processors

Source

pub fn validate_block(&self, block: &Block) -> Result<()>

Validates a block through all registered validators

Source

pub fn transform_content(&self, content: &str) -> Result<String>

Transforms content through all registered transformers

Source

pub fn processor_count(&self) -> usize

Returns the number of registered processors

Source

pub fn validator_count(&self) -> usize

Returns the number of registered validators

Source

pub fn transformer_count(&self) -> usize

Returns the number of registered transformers

Source

pub fn processor_names(&self) -> Vec<&str>

Gets a list of processor names

Source

pub fn validator_names(&self) -> Vec<&str>

Gets a list of validator names

Source

pub fn transformer_names(&self) -> Vec<&str>

Gets a list of transformer names

Source

pub fn clear(&mut self)

Clears all registered plugins

Trait Implementations§

Source§

impl Debug for PluginRegistry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PluginRegistry

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.