pub struct Plugin<T: 'static> { /* private fields */ }Expand description
Runtime handle for a service installed by an app plugin.
Component lifecycle hooks receive this through the standard extractor pipeline:
ⓘ
fn on_ready(&self, analytics: Plugin<Analytics>) {
analytics.track("ready");
}Use Option<Plugin<T>> for reusable components where the plugin is
optional.
Implementations§
Trait Implementations§
Source§impl<'a, T: 'static> From<LifecycleContext<'a>> for Plugin<T>
impl<'a, T: 'static> From<LifecycleContext<'a>> for Plugin<T>
Source§fn from(_: LifecycleContext<'a>) -> Self
fn from(_: LifecycleContext<'a>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<T> !Send for Plugin<T>
impl<T> !Sync for Plugin<T>
impl<T> Freeze for Plugin<T>
impl<T> RefUnwindSafe for Plugin<T>where
T: RefUnwindSafe,
impl<T> Unpin for Plugin<T>
impl<T> UnsafeUnpin for Plugin<T>
impl<T> UnwindSafe for Plugin<T>where
T: RefUnwindSafe,
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