pub struct PluginRegistry { /* private fields */ }Expand description
Registry for managing plugins
Handles plugin lifecycle, ordering by priority, and collecting styles.
Implementations§
Source§impl PluginRegistry
impl PluginRegistry
Sourcepub fn register<P: Plugin + 'static>(&mut self, plugin: P)
pub fn register<P: Plugin + 'static>(&mut self, plugin: P)
Register a plugin
Plugins are sorted by priority (higher priority runs first).
Sourcepub fn plugin_names(&self) -> Vec<&str>
pub fn plugin_names(&self) -> Vec<&str>
Get plugin names
Sourcepub fn has_plugin(&self, name: &str) -> bool
pub fn has_plugin(&self, name: &str) -> bool
Check if a plugin is registered
Sourcepub fn context(&self) -> &PluginContext
pub fn context(&self) -> &PluginContext
Get access to the plugin context
Sourcepub fn context_mut(&mut self) -> &mut PluginContext
pub fn context_mut(&mut self) -> &mut PluginContext
Get mutable access to the plugin context
Sourcepub fn collect_styles(&self) -> String
pub fn collect_styles(&self) -> String
Collect all CSS styles from plugins
Sourcepub fn init(&mut self) -> Result<()>
pub fn init(&mut self) -> Result<()>
Initialize all plugins
Called once when the app is being built.
Sourcepub fn tick(&mut self, delta: Duration) -> Result<()>
pub fn tick(&mut self, delta: Duration) -> Result<()>
Tick all plugins
Called on each frame update.
Sourcepub fn unmount(&mut self) -> Result<()>
pub fn unmount(&mut self) -> Result<()>
Unmount all plugins
Called when the app is shutting down. Plugins are unmounted in reverse order (lowest priority first).
Sourcepub fn update_terminal_size(&mut self, width: u16, height: u16)
pub fn update_terminal_size(&mut self, width: u16, height: u16)
Update terminal size in context
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 !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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().