pub struct PluginRegistry { /* private fields */ }Expand description
Registry for content plugins
Implementations§
Source§impl PluginRegistry
impl PluginRegistry
Sourcepub fn register(&mut self, plugin: Box<dyn ContentPlugin>)
pub fn register(&mut self, plugin: Box<dyn ContentPlugin>)
Register a plugin
Sourcepub fn get(&self, content_type: &ContentTypeId) -> Option<&dyn ContentPlugin>
pub fn get(&self, content_type: &ContentTypeId) -> Option<&dyn ContentPlugin>
Get a plugin by content type
Sourcepub fn content_types(&self) -> Vec<ContentTypeId>
pub fn content_types(&self) -> Vec<ContentTypeId>
List all registered content types
Sourcepub fn has(&self, content_type: &ContentTypeId) -> bool
pub fn has(&self, content_type: &ContentTypeId) -> bool
Check if a content type is registered
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PluginRegistry
impl !RefUnwindSafe for PluginRegistry
impl Send for PluginRegistry
impl Sync for PluginRegistry
impl Unpin for PluginRegistry
impl UnsafeUnpin for PluginRegistry
impl !UnwindSafe 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
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.