pub struct PluginManager { /* private fields */ }Expand description
Manages UI plugins and the widget type registry.
Plugins are stored in registration order. The widget type registry
is populated during add_plugin and
provides O(1) dispatch for render/measure/event operations.
Implementations§
Source§impl PluginManager
impl PluginManager
Sourcepub fn add_plugin<P: UiPlugin>(&mut self, plugin: P) -> PluginHandle<P>
pub fn add_plugin<P: UiPlugin>(&mut self, plugin: P) -> PluginHandle<P>
Add a plugin, register its widgets, and return a proof handle.
§Panics
Panics if a plugin of the same concrete type is already registered.
Sourcepub fn handle<P: UiPlugin>(&self) -> Option<PluginHandle<P>>
pub fn handle<P: UiPlugin>(&self) -> Option<PluginHandle<P>>
Get a handle for an already-registered plugin by type.
Returns Some(PluginHandle) if the plugin is registered, None otherwise.
This is useful for obtaining handles to auto-registered plugins
(e.g., DockingPlugin, ScrollPlugin).
Sourcepub fn get_mut<P: UiPlugin>(&mut self) -> Option<&mut P>
pub fn get_mut<P: UiPlugin>(&mut self) -> Option<&mut P>
Get a mutable reference to a registered plugin by type.
Sourcepub fn widget_registry(&self) -> &WidgetTypeRegistry
pub fn widget_registry(&self) -> &WidgetTypeRegistry
Get a reference to the widget type registry.
Sourcepub fn post_layout(&mut self, tree: &mut UiTree)
pub fn post_layout(&mut self, tree: &mut UiTree)
Dispatch post_layout to all plugins in registration order.
Sourcepub fn update(&mut self, dt: f32, tree: &mut UiTree)
pub fn update(&mut self, dt: f32, tree: &mut UiTree)
Dispatch update to all plugins in registration order.
Sourcepub fn handle_event(
&mut self,
event: &UiInputEvent,
ctx: &mut PluginEventContext<'_>,
) -> bool
pub fn handle_event( &mut self, event: &UiInputEvent, ctx: &mut PluginEventContext<'_>, ) -> bool
Dispatch an event to all plugins in order. Returns true if consumed.
Sourcepub fn plugin_count(&self) -> usize
pub fn plugin_count(&self) -> usize
Number of registered plugins.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PluginManager
impl !RefUnwindSafe for PluginManager
impl !Send for PluginManager
impl !Sync for PluginManager
impl Unpin for PluginManager
impl UnsafeUnpin for PluginManager
impl !UnwindSafe for PluginManager
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.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>
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